aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMike McQuaid2013-02-05 20:19:53 -0800
committerMike McQuaid2013-02-07 17:53:49 -0800
commitfaa066b109c937aae242c58b6d915925c23dbdf4 (patch)
tree396a080241e6a98b97e529b83f4a4ea28ce80bed /bin
parent7344149f52dacb0aee08344dde2676563edcce7a (diff)
downloadbrew-faa066b109c937aae242c58b6d915925c23dbdf4.tar.bz2
brew: use a shell wrapper script for brew
This allows us to force using the system Ruby on OSX but allow the development of Homebrew for Linux or Windows to not rely on OSX paths. Closes Homebrew/homebrew#17548.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/brew14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/brew b/bin/brew
new file mode 100755
index 000000000..678890050
--- /dev/null
+++ b/bin/brew
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+THIS_FILE="$0"
+[ -n "$(readlink $THIS_FILE)" ] && THIS_FILE=$(readlink $THIS_FILE)
+
+BREW_DIRECTORY=$(dirname "$THIS_FILE")/../Library
+BREW_SYSTEM=$(uname -s | tr "[:upper:]" "[:lower:]")
+
+if [ "$BREW_SYSTEM" = "darwin" ]
+then
+ exec "$BREW_DIRECTORY/brew.rb" "$@"
+else
+ exec ruby -W0 "$BREW_DIRECTORY/brew.rb" "$@"
+fi