Skip to content

Instantly share code, notes, and snippets.

@rafaelhenrique
Created June 26, 2020 13:37
Show Gist options
  • Save rafaelhenrique/b27e24b59469b0a92f82c8dcca10058e to your computer and use it in GitHub Desktop.
Save rafaelhenrique/b27e24b59469b0a92f82c8dcca10058e to your computer and use it in GitHub Desktop.
Find heroku envvar value
#!/bin/bash
# Config to find on heroku
CONFIG=$(echo $CONFIG)
if [ -z $CONFIG ]; then
echo "Syntax error! CONFIG=<config to find> $0"
exit 1
fi
ALL_APPS=( $(heroku apps -A| awk '($1 !~ "==") {print $1}') )
for((cont=0; cont<${#ALL_APPS[@]}; cont++)); do
APP=${ALL_APPS[$cont]}
heroku config -a $APP | grep $CONFIG
if [ $? -eq 0 ]; then
echo "Config is here! $APP"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment