Skip to content

Instantly share code, notes, and snippets.

@etoews etoews/remote-diff.sh
Last active Apr 12, 2017

Embed
What would you like to do?
remote-diff: a bash function to diff a local file with a remote file
# Usage: remote-diff foo.yaml https://raw.githubusercontent.com/some-org/some-repo/master/foo.yaml
# Note: It ignores lines that begin with a '#' (comments)
function remote-diff()
{
FILE=${1}
FILENAME=$(basename ${FILE})
TMP_FILE="/tmp/${FILENAME}"
REMOTE_FILE=${2}
wget --quiet ${REMOTE_FILE} --output-document ${TMP_FILE}
diff --ignore-matching-lines ^# ${FILE} ${TMP_FILE}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.