Skip to content

Instantly share code, notes, and snippets.

@danieltdt
Created October 27, 2014 15:19
Show Gist options
  • Save danieltdt/ee01de2cb285ed78018e to your computer and use it in GitHub Desktop.
Save danieltdt/ee01de2cb285ed78018e to your computer and use it in GitHub Desktop.
load .env before executing anything
set -e
set -o pipefail
root=$(cd $(dirname $0); cd ..; pwd)
PATH=$PATH:$root/node_modules/.bin
NODE_PATH=${NODE_PATH:-$root}
if [[ -f $root/.env ]]; then
while read -r dotenv_var; do
export "$dotenv_var"
done < $root/.env
fi
"${@:1}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment