2012-10-02 14:43:59 -04:00
|
|
|
#!/bin/sh
|
|
|
|
# Make sure all our local dependencies are available.
|
|
|
|
|
2012-10-03 14:12:49 -04:00
|
|
|
set -e
|
|
|
|
|
2012-10-02 14:43:59 -04:00
|
|
|
# FIX: only sudo if gem home isn't writable
|
|
|
|
|
2014-03-23 12:48:14 -04:00
|
|
|
(/usr/bin/gem list -i bundler -v '~> 1.5.3' > /dev/null) || {
|
2013-12-26 12:49:03 -05:00
|
|
|
/usr/bin/sudo -E -p "Need to install Bundler for system ruby, password for sudo: " \
|
2014-03-23 12:48:14 -04:00
|
|
|
/usr/bin/gem install bundler -v '~> 1.5.3' --no-rdoc --no-ri
|
2013-03-11 14:13:21 -04:00
|
|
|
}
|
2012-10-02 14:43:59 -04:00
|
|
|
|
|
|
|
# We don't want old config hanging around.
|
|
|
|
|
|
|
|
rm -rf .bundle/config
|
2012-10-03 13:40:34 -04:00
|
|
|
rm -rf .librarian/puppet/config
|
2012-10-02 14:43:59 -04:00
|
|
|
|
2013-07-19 15:36:27 -04:00
|
|
|
# Put xcrun shim on PATH if on MoLo
|
|
|
|
set +e
|
|
|
|
OSX_VERSION_CHECK=`sw_vers | grep ProductVersion | cut -f 2 -d ':' | egrep '10\.8'`
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
export PATH=$(pwd)/vendor/shims:$PATH
|
|
|
|
fi
|
|
|
|
set -e
|
2012-10-02 14:43:59 -04:00
|
|
|
|
2013-07-19 15:36:27 -04:00
|
|
|
# Bundle install unless we're already up to date.
|
2013-03-11 14:13:21 -04:00
|
|
|
/usr/bin/bundle install --binstubs bin --path .bundle --quiet "$@"
|
2013-12-05 19:04:14 -05:00
|
|
|
|
|
|
|
# Fix the binstubs to use system ruby
|
2014-03-31 19:54:41 -04:00
|
|
|
find bin -not -path 'bin/\.*' -type f -print0 | xargs -0 /usr/bin/sed -i '' 's|/usr/bin/env ruby|/usr/bin/ruby|g'
|