Skip to content

Commit

Permalink
exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
davedavemckay committed Jul 25, 2024
1 parent 0afc691 commit bf6d6f9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions csd3-side/scripts/lsst-backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,13 +780,14 @@ def error(self, message):

exclude = []
if args.exclude:
if '*' not in ''.join(args.exclude):
# treat as list
exclude = [f'{local_dir}/{excl}' for excl in args.exclude[0].split(',')]
else:
# treat as wildcard string
exclude = [item for sublist in [glob.glob(f'{local_dir}/{excl}') for excl in args.exclude] for item in sublist]
# exclude = glob.glob(f'{local_dir}/{args.exclude}')
# if '*' not in ''.join(args.exclude):
# # treat as list
# exclude = [f'{local_dir}/{excl}' for excl in args.exclude[0].split(',')]
# else:
# # treat as wildcard string
# exclude = [item for sublist in [glob.glob(f'{local_dir}/{excl}') for excl in args.exclude] for item in sublist]
# # exclude = glob.glob(f'{local_dir}/{args.exclude}')
exclude = args.exclude
print(f'Excluding {exclude}')

if save_config:
Expand Down

0 comments on commit bf6d6f9

Please sign in to comment.