Skip to content

Instantly share code, notes, and snippets.

@JulienBreux
Last active Sep 26, 2018
Embed
What would you like to do?
source ~/.dotenv.sh
cd()
{
debug()
{
if [ $DOTENVSH_DEBUG = true ]; then
echo $1
fi
}
loadenv()
{
debug "Loading $1"
for i in $(cat $1); do
export $i
done
}
builtin cd $@
ERR=$?
if [ $ERR -ne 0 ]; then; return $ERR; fi
if [ -e .env ]; then
loadenv .env
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment