Bladeren bron

[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 <jojwang@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Josip Sokcevic 1 jaar geleden
bovenliggende
commit
f318db0055
1 gewijzigde bestanden met toevoegingen van 4 en 0 verwijderingen
  1. 4 0
      upload_to_google_storage_first_class.py

+ 4 - 0
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):