Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
cred-diff
#!/usr/bin/env bash
# Usage
# cred-diff <env> (<branch|ref>|master)
# eg
# cred-diff production master
VAR=$2
REF="${VAR:-master}"
git checkout $REF --quiet
printf .
rails credentials:show --environment $1 > /tmp/prod
printf .
git checkout - --quiet
printf .
rails credentials:show --environment $1 > /tmp/yours
echo
diff -C5 --label $REF /tmp/prod /tmp/yours --label "Here"
rm /tmp/prod /tmp/yours
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment