Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
internal: runtime: zip: fix the ignoring logic for top level director…
Browse files Browse the repository at this point in the history
…ies (#148)

Signed-off-by: brkp <[email protected]>
  • Loading branch information
nullptropy authored Aug 30, 2023
1 parent 8eb483e commit 7969567
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/runtime/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@ func ZipDir(sourceDir string) ([]byte, int, error) {
if err != nil {
return err
}
if path == absDir {
return nil
}

// matching against the the `TrimPrefix`ed transformation so that you can have your
// project in a folder called `dist`, for example.
// skip if shouldSkip according to skipPaths which are derived from .spaceignore
shouldSkip := spaceignore.MatchesPath(path)
shouldSkip := spaceignore.MatchesPath(strings.TrimPrefix(path, absDir+"/"))
if shouldSkip && info.IsDir() {
return filepath.SkipDir
}
Expand Down

0 comments on commit 7969567

Please sign in to comment.