Skip to content

Instantly share code, notes, and snippets.

@cj
Created September 16, 2014 20:23
Show Gist options
  • Save cj/1ea2849a56ec83cb1cad to your computer and use it in GitHub Desktop.
Save cj/1ea2849a56ec83cb1cad to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ -f .env ]]; then
eval "$(awk '/^[A-Z]/ { print "export " $0 }' .env)"
if [[ $# -gt 0 ]]; then
"$@"
elif [[ -z $PS2 ]]; then
$SHELL
fi
else
echo "No .env file found. Aborting." >&2
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment