Skip to content

Commit

Permalink
Don't try to zip empty dir (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofalvai authored Aug 23, 2024
1 parent 04a173a commit f14128c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,15 @@ func collectFilesToDeploy(absDeployPth string, config Config, tmpDir string, log
} else if config.IsCompress {
logger.Printf("Build Artifact deployment mode: deploying compressed deploy directory")

entries, err := os.ReadDir(absDeployPth)
if err != nil {
return nil, fmt.Errorf("read contents of %s: %s", absDeployPth, err)
}
if len(entries) == 0 {
logger.Donef("Directory is empty, nothing to compress")
return nil, nil
}

zipName := filepath.Base(absDeployPth)
if config.ZipName != "" {
zipName = config.ZipName
Expand Down

0 comments on commit f14128c

Please sign in to comment.