ambevar-dotfiles/.scripts/git-compare

17 lines
293 B
Bash
Executable File

#!/bin/sh
if [ $# -ne 1 ]; then
cat <<EOF>&2
Usage: ${0##*/} FOLDER
Compare current git repo with FOLDER.
EOF
exit 1
fi
REPO="$(mktemp)"
FOLDER="$(mktemp)"
git ls-files | sort > "$REPO"
find "$1" -type f ! -path "*.git/*" | sed 's/^[^\/]*\///g' | sort > "$FOLDER"
rm -f "$REPO" "$FOLDER"