Skip to content

Commit 1945b84

Browse files
authored
Update cli.py
1 parent 89cb1bf commit 1945b84

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

caltechdata_api/cli.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,13 @@ def upload_supporting_file(record_id=None):
405405
print("\n".join(files))
406406
while True:
407407
filename = get_user_input(
408-
"Enter the filename to upload as a supporting file (or 'n' to finish): "
408+
"Enter the filename to upload as a supporting file (or '*' to get all files currently in the directory, otherwise 'n' to finish): "
409409
)
410+
if filename == "*":
411+
for files_name in files:
412+
filepath = os.path.abspath(files_name)
413+
filepaths.append(filepath)
414+
print("All files added successfully")
410415
if filename == "n":
411416
break
412417
if filename in files:
@@ -420,6 +425,7 @@ def upload_supporting_file(record_id=None):
420425
else:
421426
filepath = os.path.abspath(filename)
422427
filepaths.append(filepath)
428+
print("File added successfully")
423429
else:
424430
print(
425431
f"Error: File '{filename}' not found. Please enter a valid filename."

0 commit comments

Comments
 (0)