From a5957dbd4d91c837dd03fb8b6fcd44b3ea3e096d Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Tue, 11 Dec 2012 22:15:40 +0000 Subject: [PATCH] ninja: Add a friendlier error message if no prebuilt binary is found. See https://bugs.webkit.org/show_bug.cgi?id=104523 Review URL: https://chromiumcodereview.appspot.com/11485007 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@172427 0039d316-1c4b-4281-b951-d872f2087c98 --- ninja | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ninja b/ninja index b9cd0d1b2..c01f23436 100755 --- a/ninja +++ b/ninja @@ -7,12 +7,24 @@ OS="$(uname -s)" THIS_DIR="$(dirname "${0}")" +function print_help() { +cat <<-EOF +No prebuilt ninja binary was found for this system. +Try building your own binary by doing: + cd ~ + git clone https://github.com/martine/ninja.git -b v1.0.0 + ./ninja/bootstrap.py +Then add ~/ninja/ to your PATH. +EOF +} + case "$OS" in Linux) MACHINE=$(getconf LONG_BIT) case "$MACHINE" in 32|64) exec "${THIS_DIR}/ninja-linux${MACHINE}" "$@";; *) echo Unknown architecture \($MACHINE\) -- unable to run ninja. + print_help exit 1;; esac ;; @@ -20,5 +32,6 @@ case "$OS" in CYGWIN*) exec cmd.exe /c $(cygpath -t windows $0).exe "$@";; MINGW32*) cmd.exe //c $0.exe "$@";; *) echo "Unsupported OS ${OS}" + print_help exit 1;; esac