bitrise-steplib / bitrise-step-save-cache

1 stars 5 forks source link

Fix pattern matching in absolute paths #16

Closed ofalvai closed 2 years ago

ofalvai commented 2 years ago

Checklist

Version

Requires a MAJOR/MINOR/PATCH version update

Context

Pattern matching in the paths input is not working when the path is an absolute path (or one that gets expanded to an absolute path), such as:

~/Library/Developer/Xcode/DerivedData/**/SourcePackages

Changes

Fix glob pattern matching by splitting the path input into a base path and a pattern. Relevant section from the docs of doublestar.Glob():

// Like io/fs.Glob(), patterns containing /./, /../, or starting with / // will return no results and no errors. You can use SplitPattern to divide a // pattern into a base path (to initialize an FS object) and pattern.

Investigation details

Decisions