Last active
March 18, 2019 01:53
-
-
Save rasgo-cc/876459af703afd9c973adab6896ce293 to your computer and use it in GitHub Desktop.
Fetch Heroku config vars and save them into a dotenv file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: heroku_dotenv.sh <heroku_app_name> <dotenv_file> | |
# Default dotenv_file: .env | |
dotenv=${2-".env"} | |
heroku config -a $1 | | |
sed -n '1!p' | | |
awk '{ gsub(/:/,"", $1); f=$1; $1=""; print f"="substr($0,2) }' > $dotenv | |
cat $dotenv | |
echo "File written: $dotenv" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment