Created
March 31, 2011 22:37
-
-
Save jordansissel/897409 to your computer and use it in GitHub Desktop.
An attempt to copy the current rvm instance into a monolithic package.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
builddir="build/monolithic" | |
mkdir -p $builddir | |
# Copy gems | |
for path in $(echo "$GEM_PATH" | tr ":" " "); do | |
echo "Copying $path" | |
rsync -a "$GEM_HOME/" $builddir/gem | |
done | |
# Copy ruby | |
echo "Copying $MY_RUBY_HOME" | |
rsync -a "$MY_RUBY_HOME/" $builddir/ruby | |
# Create a file for sourcing in shell to use this specific ruby | |
cat > "${builddir}/use_this_ruby.rc" <<END | |
name=\$BASH_SOURCE | |
[ -z "\$name" ] && name=\$0 | |
dir=\$(dirname \$name) | |
[ "$dir" = "." ] && dir="\$PWD" | |
GEM_HOME=\$dir/gems | |
GEM_PATH=\$dir/gems | |
PATH=./\$dir/ruby/bin:${PATH} | |
export GEM_HOME | |
export GEM_PATH | |
export PATH | |
END | |
echo $builddir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment