Changed: The `source` path for `compress` now has pattern expansion

Fixes #152
This commit is contained in:
Salvador E. Tropea 2022-02-17 10:56:11 -03:00
parent b5ff069a63
commit 174bd44a09
3 changed files with 4 additions and 2 deletions

View File

@ -80,6 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The `%d/%sd/%bd` expansion patterns are now affected by the global `date_format`.
Can be disabled using `date_reformat: false`. (#121)
- The default output pattern now includes the `output_id` (%I)
- The `source` path for `compress` now has pattern expansion (#152)
### Fixed
- Position files now defaults to use the auxiliary origin as KiCad.

View File

@ -148,7 +148,8 @@ class CompressOptions(BaseOptions):
exit(INTERNAL_ERROR)
else:
out_dir = out_dir_cwd if f.from_cwd else out_dir_default
files_list = glob.iglob(os.path.join(out_dir, f.source), recursive=True)
source = f.expand_filename_both(f.source, make_safe=False)
files_list = glob.iglob(os.path.join(out_dir, source), recursive=True)
# Filter and adapt them
for fname in filter(re.compile(f.filter).match, files_list):
fname_real = os.path.realpath(fname)

View File

@ -10,7 +10,7 @@ outputs:
format: TAR
compression: bzip2
files:
- source: tests/board_samples/kicad_5/test_v5.*
- source: tests/board_samples/kicad_5/%f.*
from_cwd: true
dest: source
- source: tests/board_samples/kicad_5/deeper.sch