Skip to content

Instantly share code, notes, and snippets.

@davidmroth
Created October 31, 2018 10:10
Show Gist options
  • Save davidmroth/0a2293eb1fa4597a1b18948b09b5af56 to your computer and use it in GitHub Desktop.
Save davidmroth/0a2293eb1fa4597a1b18948b09b5af56 to your computer and use it in GitHub Desktop.
Check folders for changes
#!/bin/bash
ROOT_FOLDERS="WordpressSiteSync theme $(find plugins/ -maxdepth 1 -type d)"
for folder in $ROOT_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