Permalink
Find file
executable file 22 lines (17 sloc) 530 Bytes
#!/bin/bash
# The actual `bin/compile` code lives in `bin/ruby_compile`. This file instead
# bootstraps the ruby needed and then executes `bin/ruby_compile`
BIN_DIR=$(cd $(dirname $0); pwd)
ROOT_DIR=$(dirname $BIN_DIR)
ruby_dir="$ROOT_DIR/vendor/ruby/$STACK"
if [ ! -d "$ROOT_DIR/vendor/ruby/$STACK" ]; then
ruby_dir=$(mktemp -d)
# bootstrap ruby
$BIN_DIR/bootstrap $ruby_dir
function atexit {
rm -rf $ruby_dir
}
trap atexit EXIT
fi
export PATH=$ruby_dir/bin/:$PATH
$ruby_dir/bin/ruby $BIN_DIR/ruby_compile $@