Chromium Code Reviews

Unified Diff: ninja

Issue 11485007: ninja: Add a friendlier error message if no prebuilt binary is found. (Closed) Base URL: http://src.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« 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: ninja
===================================================================
--- ninja (revision 171134)
+++ ninja (working copy)
@@ -7,8 +7,26 @@
OS="$(uname -s)"
THIS_DIR="$(dirname "${0}")"
+function print_help() {
+ echo "No prebuilt ninja binary was found for this system."
Lei Zhang 2012/12/10 20:34:45 you can also: cat << __EOF here is my message __E
Nico 2012/12/11 04:49:34 Done.
+ echo "Try building your own binary by doing:"
+ echo " cd ~"
+ echo " git clone https://github.com/martine/ninja.git"
+ echo " cd ninja"
+ echo " git checkout v1.0.0"
+ echo " ./bootstrap.py"
+ echo "Then add ~/ninja/ to your PATH."
+}
+
if [ "${OS}" = "Linux" ]; then
- exec "${THIS_DIR}/ninja-linux64" "$@"
+ machine=$(getconf LONG_BIT)
+ if [ "$machine" = "64" ]; then
+ exec "${THIS_DIR}/ninja-linux64" "$@"
+ else
+ echo "Unsupported machine ${machine}"
+ print_help
+ exit 1
+ fi
elif [ "${OS}" = "Darwin" ]; then
exec "${THIS_DIR}/ninja-mac" "$@"
elif [[ ${OS} == CYGWIN* ]]; then
@@ -17,6 +35,6 @@
cmd.exe //c $0.exe "$@"
else
echo "Unsupported OS ${OS}"
+ print_help
exit 1
fi
-
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine