Skip to content

Instantly share code, notes, and snippets.

@davidmroth
Last active September 28, 2018 00:20
Show Gist options
  • Save davidmroth/8ef935afe09e4bf297fdb6ec37f5f70f to your computer and use it in GitHub Desktop.
Save davidmroth/8ef935afe09e4bf297fdb6ec37f5f70f to your computer and use it in GitHub Desktop.
Check for local git changes
#!/bin/bash
SCAN_FOLDERS="theme $(find plugins/ -maxdepth 1 -type d)"
for folder in $SCAN_FOLDERS; do
if test -e $folder/.git; then
echo "Checking $folder for changes..."
hascommit=$(cd $folder; test -z "$(git status --porcelain)" || echo yes);
if test ! -z "$hascommit"; then
echo -e "\t$folder has changes!"
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment