Skip to content

Commit db2f75d

Browse files
authored
Merge pull request #107 from netlify/asset-mgmt-fix
Fix the read file issue for asset management
2 parents b5a114b + 3577aff commit db2f75d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

go/porcelain/deploy.go

+6
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ func (n *Netlify) DoDeploy(ctx context.Context, options *DeployOptions, deploy *
162162
}
163163
}
164164

165+
context.GetLogger(ctx).Infof("Getting files info with asset management flag: %v", deploy.SiteCapabilities.AssetManagement)
165166
files, err := walk(options.Dir, options.Observer, deploy.SiteCapabilities.AssetManagement)
166167
if err != nil {
167168
if options.Observer != nil {
@@ -489,6 +490,11 @@ func walk(dir string, observer DeployObserver, useAssetManagement bool) (*deploy
489490
file.Sum = hex.EncodeToString(s.Sum(nil))
490491

491492
if useAssetManagement {
493+
o, err := os.Open(path)
494+
if err != nil {
495+
return err
496+
}
497+
defer o.Close()
492498
originalSha := getAssetManagementSha(o)
493499
if originalSha != "" {
494500
file.Sum += ":" + string(originalSha)

0 commit comments

Comments
 (0)