Last active
April 12, 2017 22:04
-
-
Save etoews/0d3b57cc6c5fe4dca290b2bbcd75b8db to your computer and use it in GitHub Desktop.
remote-diff: a bash function to diff a local file with a remote file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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