Chromium Code Reviews| 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) |