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

Side by Side 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: rebase again Created 8 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2012 Google Inc. All rights reserved. 3 # Copyright (c) 2012 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 OS="$(uname -s)" 7 OS="$(uname -s)"
8 THIS_DIR="$(dirname "${0}")" 8 THIS_DIR="$(dirname "${0}")"
9 9
10 function print_help() {
11 cat <<-EOF
12 No prebuilt ninja binary was found for this system.
13 Try building your own binary by doing:
14 cd ~
15 git clone https://github.com/martine/ninja.git -b v1.0.0
16 ./ninja/bootstrap.py
17 Then add ~/ninja/ to your PATH.
18 EOF
19 }
20
10 case "$OS" in 21 case "$OS" in
11 Linux) 22 Linux)
12 MACHINE=$(getconf LONG_BIT) 23 MACHINE=$(getconf LONG_BIT)
13 case "$MACHINE" in 24 case "$MACHINE" in
14 32|64) exec "${THIS_DIR}/ninja-linux${MACHINE}" "$@";; 25 32|64) exec "${THIS_DIR}/ninja-linux${MACHINE}" "$@";;
15 *) echo Unknown architecture \($MACHINE\) -- unable to run ninja. 26 *) echo Unknown architecture \($MACHINE\) -- unable to run ninja.
27 print_help
16 exit 1;; 28 exit 1;;
17 esac 29 esac
18 ;; 30 ;;
19 Darwin) exec "${THIS_DIR}/ninja-mac" "$@";; 31 Darwin) exec "${THIS_DIR}/ninja-mac" "$@";;
20 CYGWIN*) exec cmd.exe /c $(cygpath -t windows $0).exe "$@";; 32 CYGWIN*) exec cmd.exe /c $(cygpath -t windows $0).exe "$@";;
21 MINGW32*) cmd.exe //c $0.exe "$@";; 33 MINGW32*) cmd.exe //c $0.exe "$@";;
22 *) echo "Unsupported OS ${OS}" 34 *) echo "Unsupported OS ${OS}"
35 print_help
23 exit 1;; 36 exit 1;;
24 esac 37 esac
OLDNEW
« 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