Skip to content

Instantly share code, notes, and snippets.

@roryk
Created December 25, 2015 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roryk/318b347128bf5df8fee5 to your computer and use it in GitHub Desktop.
Save roryk/318b347128bf5df8fee5 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
# Figure out where this script is located.
SELFSCRIPT="`readlink -f \"$0\"`"
SELFDIR="`dirname \"$SELFSCRIPT\"`"
SELFDIR="`cd \"$SELFDIR\" && pwd`"
# Temporarily set PATH and LD_LIBRARY_PATH
export PATH=$SELFDIR/bin:$PATH
export LD_LIBRARY_PATH=$SELFDIR/lib:$LD_LIBRARY_PATH
export DYLD_FALLBACK_LIBRARY_PATH=$SELFDIR/lib:$DYLD_FALLBACK_LIBRARY_PATH
# Tell Bundler where the Gemfile and gems are.
export BUNDLE_GEMFILE="$SELFDIR/lib/app/Gemfile"
unset BUNDLE_IGNORE_CONFIG
# Tell transrate this is the packaged version
export TRANSRATE_PACKAGED_BINARY=true
# Run the actual app using the bundled Ruby interpreter, with Bundler activated.
exec "$SELFDIR/lib/app/ruby/bin/ruby" -rbundler/setup "$SELFDIR/lib/app/bin/transrate" $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment