Skip to content

Instantly share code, notes, and snippets.

@SimonWoolf
Created April 18, 2016 10:39
Show Gist options
  • 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