aboutsummaryrefslogtreecommitdiffstats
path: root/Library/ENV
diff options
context:
space:
mode:
authorMartin Afanasjew2016-01-10 17:33:54 +0100
committerMartin Afanasjew2016-02-05 22:07:07 +0100
commit49990ee93fddb74cb36cec8d7b17946a853ed39c (patch)
tree1b7dae0dadb62294be2535f6d999ec5b987c5675 /Library/ENV
parent12a452557d7695dba69f488a95a77a2650d28251 (diff)
downloadbrew-49990ee93fddb74cb36cec8d7b17946a853ed39c.tar.bz2
ENV: use HOMEBREW_RUBY_PATH in compiler/SCM shims
Use the same interpreter for the shims that is also used to run the main Homebrew process (the one invoked via `brew`). The magic basically lies in executing `ruby` with the `-x` option (supported since at least 1.8) and in the following shebang line.
Diffstat (limited to 'Library/ENV')
-rwxr-xr-xLibrary/ENV/4.3/cc6
-rwxr-xr-xLibrary/ENV/scm/git6
2 files changed, 9 insertions, 3 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc
index 659599544..b48abde03 100755
--- a/Library/ENV/4.3/cc
+++ b/Library/ENV/4.3/cc
@@ -1,6 +1,8 @@
-#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0
+#!/bin/sh
+# Make sure this shim uses the same Ruby interpreter that is used by Homebrew.
+exec "$HOMEBREW_RUBY_PATH" -x "$0" "$@"
+#!/usr/bin/env ruby -W0
-$:.unshift Dir["/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/lib/ruby/{1.8,2.0.0}"].first
require "pathname"
require "set"
diff --git a/Library/ENV/scm/git b/Library/ENV/scm/git
index 0c768403c..57484a078 100755
--- a/Library/ENV/scm/git
+++ b/Library/ENV/scm/git
@@ -1,4 +1,8 @@
-#!/usr/bin/ruby -W0
+#!/bin/sh
+# Make sure this shim uses the same Ruby interpreter that is used by Homebrew.
+exec "$HOMEBREW_RUBY_PATH" -x "$0" "$@"
+#!/usr/bin/env ruby -W0
+
# This script because we support $GIT, $HOMEBREW_SVN, etc. and Xcode-only
# configurations. Order is careful to be what the user would want.