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

Side by Side Diff: ninja

Issue 11522008: Clean up the style in the ninja shell wrapper. (Closed) Base URL: svn://svn.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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« 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 if [ "${OS}" = "Linux" ]; then 10 case "$OS" in
11 machine=$(getconf LONG_BIT) 11 Linux)
12 if [[ "$machine" = "64" ]]; then 12 MACHINE=$(getconf LONG_BIT)
13 exec "${THIS_DIR}/ninja-linux64" "$@" 13 case "$MACHINE" in
14 elif [[ "$machine" = "32" ]]; then 14 64) exec "${THIS_DIR}/ninja-linux64" "$@";;
iannucci 2012/12/11 00:25:34 I might do something like: 32|64) exec "${THIS_DI
tony 2012/12/11 00:34:52 Done.
15 exec "${THIS_DIR}/ninja-linux32" "$@" 15 32) exec "${THIS_DIR}/ninja-linux32" "$@";;
16 else 16 *) echo Unknown architecture \($MACHINE\) -- unable to run ninja.
17 echo Unknown architecture \($machine\) -- unable to run ninja. 17 exit 1
18 exit 1 18 ;;
19 fi 19 esac
20 elif [ "${OS}" = "Darwin" ]; then 20 ;;
21 Darwin)
iannucci 2012/12/11 00:25:34 Maybe these can all be on one line each like for t
tony 2012/12/11 00:34:52 Done.
21 exec "${THIS_DIR}/ninja-mac" "$@" 22 exec "${THIS_DIR}/ninja-mac" "$@"
22 elif [[ ${OS} == CYGWIN* ]]; then 23 ;;
24 CYGWIN*)
23 exec cmd.exe /c `cygpath -t windows $0`.exe "$@" 25 exec cmd.exe /c `cygpath -t windows $0`.exe "$@"
iannucci 2012/12/11 00:25:34 Should use $() over ``
tony 2012/12/11 00:34:52 Done.
24 elif [[ ${OS} == MINGW32* ]]; then 26 ;;
27 MINGW32*)
25 cmd.exe //c $0.exe "$@" 28 cmd.exe //c $0.exe "$@"
26 else 29 ;;
30 *)
27 echo "Unsupported OS ${OS}" 31 echo "Unsupported OS ${OS}"
28 exit 1 32 exit 1
29 fi 33 ;;
30 34 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