Skip to content

Instantly share code, notes, and snippets.

@ketiko
Last active June 2, 2020 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ketiko/2079a81359c37122aa876e9d45d6a251 to your computer and use it in GitHub Desktop.
Save ketiko/2079a81359c37122aa876e9d45d6a251 to your computer and use it in GitHub Desktop.
Example script to diff two akkeris applications configurations
#!/bin/sh
set -eo pipefail
IFS=$'\n\t'
APP_A=$1
APP_B=$2
if [ -z "$APP_A" ]; then
echo "You must input two akkeris application names"
exit 1
fi
if [ -z "$APP_B" ]; then
echo "You must input two akkeris application names"
exit 1
fi
TMP_CONFIG_A=$(mktemp)
TMP_CONFIG_B=$(mktemp)
function cleanup() {
rm $TMP_CONFIG_A
rm $TMP_CONFIG_B
}
trap cleanup EXIT
aka config -s -a $APP_A &> $TMP_CONFIG_A
aka config -s -a $APP_B &> $TMP_CONFIG_B
DIFF_TOOL=$(git config diff.tool)
DIFF_CMD=$(git config difftool.$DIFF_TOOL.cmd)
LOCAL=$TMP_CONFIG_A
REMOTE=$TMP_CONFIG_B
eval $DIFF_CMD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment