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

Unified Diff: pydir/utils.py

Issue 1565963002: Better error message for running szbuild.py out of directory. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Look for BaseNaCl in executable name if not in cwd Created 4 years, 11 months 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: pydir/utils.py
diff --git a/pydir/utils.py b/pydir/utils.py
index 6fdedfafae03f4d1968e303661a9107c699fe818..6039e777a2dca277eee8789a2649d8f57d176eaf 100644
--- a/pydir/utils.py
+++ b/pydir/utils.py
@@ -16,8 +16,11 @@ def FindBaseNaCl():
"""Find the base native_client/ directory."""
nacl = 'native_client'
path_list = os.getcwd().split(os.sep)
+ """Use the executable path if cwd does not contain 'native_client' """
+ path_list = path_list if nacl in path_list else sys.argv[0].split(os.sep)
if nacl not in path_list:
- return None
+ print "Script must be executed from within 'native_client' directory"
+ exit(1)
last_index = len(path_list) - path_list[::-1].index(nacl)
return os.sep.join(path_list[:last_index])
« 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