Skip to content

Commit

Permalink
Fix bug when no --exclude is used
Browse files Browse the repository at this point in the history
  • Loading branch information
garyo committed Oct 17, 2018
1 parent cef4992 commit c156eaa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build-binary-artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def make_zipfile(dirs, manifest, manifest_name, outname, top_level_name, outdir,
for dir in dirs:
f.write(dir, '%s/%s' % (top_level_name, dir))
for root, dirs, files in os.walk(dir):
# print(f'Processing {root} {dirs} {files}')
dirs[:] = [d for d in dirs if d not in exclude]
for file in files:
if exclude is None or file not in exclude:
Expand Down Expand Up @@ -314,7 +315,7 @@ class CustomFormatter(argparse.ArgumentDefaultsHelpFormatter,
help="""Don't build the archive; just return the hash of the given dir.""")
parser.add_argument('--validate', action='store_true',
help="""Validate an unpacked archive by checking its hash against the manifest.""")
parser.add_argument('--exclude', action='append',
parser.add_argument('--exclude', action='append', default=[],
help="""Exclude this filename from the archive. May be repeated.""")
parser.add_argument('dir', nargs='+',
help="""dirs to collect into the binary artifact""")
Expand Down

0 comments on commit c156eaa

Please sign in to comment.