Skip to content

Instantly share code, notes, and snippets.

@SimonWoolf
Created April 18, 2016 10:39
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 SimonWoolf/fc143bc2de24121efe5f5e020ea9eb89 to your computer and use it in GitHub Desktop.
Save SimonWoolf/fc143bc2de24121efe5f5e020ea9eb89 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# This script expects an extracted slug to exist at /app, changes to that
# directory then execs whatever command was given on the command line.
set -eo pipefail
export HOME=/app
cd "${HOME}"
if [[ -d ".profile.d" ]]; then
for file in .profile.d/*; do
source "${file}"
done
fi
# Reset shell hash tables so the path to executable is not cached
hash -r
exec "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment