Skip to content

Instantly share code, notes, and snippets.

@krstffr
Created November 27, 2016 13:29
Show Gist options
  • Save krstffr/6a71b913fd4d642b8086ee69f0e93333 to your computer and use it in GitHub Desktop.
Save krstffr/6a71b913fd4d642b8086ee69f0e93333 to your computer and use it in GitHub Desktop.
Getting all your Heroku env vars from all your apps listed in one file!
# First store all of your apps in a file
heroku apps > heroku-apps.txt
# Manually remove everything which is not an app name from the file, for example the first line ("=== name@domain.com Apps")
# (Now you should have a file with only one appname per line)
# Pipe the text file into xargs -n1, which in turn passes every line into the "heroku-config -a $1" command, and then
# pass the result of that into the heroku-apps-with-config.txt
cat heroku-apps.txt | xargs -n1 heroku config -a $1 > heroku-apps-with-config.txt
# Get all of the env vars!
cat heroku-apps-with-config.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment