aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2013-02-05 20:19:53 -0800
committerMike McQuaid2013-02-07 17:53:49 -0800
commit225546a3ee2d3f22e185e47d4db6f6716a56669b (patch)
treee4a6d4fbc497289712b189d4f39704125ac66453
parent67d06b84d00a17cf43770eedf34e37e50e209741 (diff)
downloadhomebrew-225546a3ee2d3f22e185e47d4db6f6716a56669b.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 #17548.
-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