Skip to content

Commit 6aaaf6f

Browse files
authored
Merge pull request #146 from netlify/fix_nil_deploy
Ignore nil deploys.
2 parents bd6e803 + c0ef1ba commit 6aaaf6f

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

go/porcelain/deploy.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ type DeployObserver interface {
6464

6565
// DeployOptions holds the option for creating a new deploy
6666
type DeployOptions struct {
67-
SiteID string
68-
Dir string
69-
FunctionsDir string
67+
SiteID string
68+
Dir string
69+
FunctionsDir string
70+
LargeMediaEnabled bool
7071

7172
IsDraft bool
7273

@@ -173,8 +174,13 @@ func (n *Netlify) DoDeploy(ctx context.Context, options *DeployOptions, deploy *
173174
}
174175
}
175176

176-
context.GetLogger(ctx).Infof("Getting files info with large media flag: %v", deploy.SiteCapabilities.LargeMediaEnabled)
177-
files, err := walk(options.Dir, options.Observer, deploy.SiteCapabilities.LargeMediaEnabled)
177+
largeMediaEnabled := options.LargeMediaEnabled
178+
if !largeMediaEnabled && deploy != nil {
179+
largeMediaEnabled = deploy.SiteCapabilities.LargeMediaEnabled
180+
}
181+
182+
context.GetLogger(ctx).Infof("Getting files info with large media flag: %v", largeMediaEnabled)
183+
files, err := walk(options.Dir, options.Observer, largeMediaEnabled)
178184
if err != nil {
179185
if options.Observer != nil {
180186
options.Observer.OnFailedWalk()

0 commit comments

Comments
 (0)