Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1216)

Unified Diff: gclient-new-workdir.py

Issue 68213010: Clearer help in gclient-new-workdir.py (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient-new-workdir.py
diff --git a/gclient-new-workdir.py b/gclient-new-workdir.py
index 91ba35b9efbd224ee6995770e1ccc06be0b7cd5f..1d385d0a2771a9fe6e6366e2dec31fd137c64eda 100755
--- a/gclient-new-workdir.py
+++ b/gclient-new-workdir.py
@@ -8,21 +8,32 @@
#
import os
+import os.path
M-A Ruel 2013/11/12 17:40:07 Not needed.
import shutil
import subprocess
import sys
def parse_options(argv):
- assert not sys.platform.startswith("win")
+ if sys.platform.startswith("win"):
M-A Ruel 2013/11/12 17:40:07 On windows, it'll always be 'win32', so use: if sy
+ print("This script cannot run on Windows because it uses symlinks.")
M-A Ruel 2013/11/12 17:40:07 you should print to sys.stderr. I see the rest of
+ sys.exit(1)
if len(argv) != 3:
- print("usage: gclient-new-workdir.py <repository> <new_workdir>")
+ print("""usage: gclient-new-workdir.py <repository> <new_workdir>
+
+ <repository> must be a absolute path
+ <new_workdir> must not exist
+ """)
sys.exit(1)
repository = argv[1]
new_workdir = argv[2]
+ if not os.path.isabs(argv[1]):
+ print("First argument (repository) must be an absolute path.")
M-A Ruel 2013/11/12 17:40:07 Why not argv[1] = os.path.abspath(argv[1]) ?
+ sys.exit(1)
+
if not os.path.exists(repository):
print("Repository does not exist: " + repository)
sys.exit(1)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698