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

Unified Diff: git-runhooks

Issue 12941002: Invoke python correctly from windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 9 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: git-runhooks
diff --git a/git-runhooks b/git-runhooks
index 49fe9462d5854a77714b6f31b95c6c246019270a..35af2eaa424044073d6aacef1aa8d353529a6546 100755
--- a/git-runhooks
+++ b/git-runhooks
@@ -12,5 +12,12 @@ if ! test -f "$PWD/src/.gitmodules"; then
fi
gclient_spec="solutions=[{'name':'src','url':None,'deps_file':'.DEPS.git'}]"
-gclient runhooks --spec="$gclient_spec"
+kernel_name=$(uname -s)
+if [ "${kernel_name:0:5}" = "MINGW" ]; then
+ dir="${0%\\*}"
iannucci 2013/03/19 20:29:24 why not dirname? Is it not available?
szager1 2013/03/19 20:31:38 dirname is hard-coded to look for '/', but $0 will
+ cmd "/C ${dir}\\python.bat ${dir}\\gclient.py runhooks --spec=$gclient_spec"
+else
+ dir="$(dirname $0)"
+ PYTHONDONTWRITEBYTECODE=1 exec python "$dir/gclient.py" runhooks --spec="$gclient_spec"
+fi
exit $?
« 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