Skip to content

Commit

Permalink
Merge pull request #25 from lilab-bcb/yiming
Browse files Browse the repository at this point in the history
Error handling for wildcard expanding
  • Loading branch information
yihming authored May 7, 2024
2 parents b7e641c + ebf3713 commit 42de52c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion strato/backends/_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ def copy(self, recursive, ionice, filenames, quiet, dryrun):
for path in filenames[:-1]:
if "*" in path:
f_list = glob.glob(path)
source_files.extend(f_list)
if len(f_list) > 0:
source_files.extend(f_list)
else:
print(f"Cannot find '{path}'!")
else:
source_files.append(path)
assert len(source_files) > 0, "Source file(s) cannot be empty!"

# if copying recursively or there are multiple source files,
# assume target is directory, otherwise assume target is file path
Expand Down

0 comments on commit 42de52c

Please sign in to comment.