From f318db0055b10ab5c4f6f9566d826c7adaf005e9 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Tue, 28 May 2024 21:14:21 +0000 Subject: [PATCH] [GCS] Allow upload of the entire directory to GS Allow users to upload the entire directory by providing . or ./ as the path. R=jojwang@google.com Bug: 343199633 Change-Id: Idf2a6b27577bb9ef153e096f00367084daab9239 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5578674 Reviewed-by: Joanna Wang Commit-Queue: Josip Sokcevic --- upload_to_google_storage_first_class.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/upload_to_google_storage_first_class.py b/upload_to_google_storage_first_class.py index fe0812a88..f0d53368c 100755 --- a/upload_to_google_storage_first_class.py +++ b/upload_to_google_storage_first_class.py @@ -213,6 +213,10 @@ def main(): # Enumerate our inputs. input_filenames = get_targets(args, parser, options.use_null_terminator) + # Allow uploading the entire directory + if len(input_filenames) == 1 and input_filenames[0] in ('.', './'): + input_filenames = next(os.walk('.'))[1] + if len(input_filenames) > 1 or (len(input_filenames) == 1 and os.path.isdir(input_filenames[0])): if not validate_archive_dirs(input_filenames):