Skip to content

Instantly share code, notes, and snippets.

@dcadenas
Created June 6, 2015 01:37
Show Gist options
  • Save dcadenas/6a762638c9c3b18e58d0 to your computer and use it in GitHub Desktop.
Save dcadenas/6a762638c9c3b18e58d0 to your computer and use it in GitHub Desktop.
Shows ENV vars in the Rails app that can't be found in the heroku config
#!/bin/bash
echo "These ENV variables only exist in the rails app but not in the heroku config"
echo
envs_in_rails() {
git grep "ENV\[" | sed "s/.*ENV\[['\"]\(.*\)['\"]\].*/\1/" | sort | uniq
}
envs_in_heroku() {
heroku config | sed "s/^\([A-Z][^:]*\):.*/\1/" | sort | uniq
}
comm -23 <(envs_in_rails) <(envs_in_heroku)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment