Skip to content

Instantly share code, notes, and snippets.

@JulienBreux
Last active September 26, 2018 08:14
Show Gist options
  • Save JulienBreux/2dbbd0ce591410ec1cf0c83269981552 to your computer and use it in GitHub Desktop.
Save JulienBreux/2dbbd0ce591410ec1cf0c83269981552 to your computer and use it in GitHub Desktop.
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