Skip to content

Instantly share code, notes, and snippets.

@wachukxs
Created September 11, 2023 07:25
Show Gist options
  • Save wachukxs/e7ce5a96f708f315e554054e7d9d77ef to your computer and use it in GitHub Desktop.
Save wachukxs/e7ce5a96f708f315e554054e7d9d77ef to your computer and use it in GitHub Desktop.
.sh command to auto export your .env content to Heroku
#!/bin/zsh
# set -o allexport
# source .env
# set +o allexport
while read line;
do
if [[ $line == "#"* ]] || [[ $line == "" ]] || [[ $line == ";"* ]] ;
then
echo "skipping comment or empty line:" $line;
else
echo "writing" $line;
# heroku config:set GITHUB_USERNAME=joesmith
heroku config:set $line
fi
done<.env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment