Skip to content

Instantly share code, notes, and snippets.

@danieltdt
Created October 27, 2014 15:19

Revisions

  1. danieltdt created this gist Oct 27, 2014.
    15 changes: 15 additions & 0 deletions dotenv
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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}"