Skip to content

Instantly share code, notes, and snippets.

@aidan-harding
Created July 8, 2021 14:55
Show Gist options
  • Save aidan-harding/7fc6936ba08f8ea4970399f96f5a5c72 to your computer and use it in GitHub Desktop.
Save aidan-harding/7fc6936ba08f8ea4970399f96f5a5c72 to your computer and use it in GitHub Desktop.
#!/bin/zsh
#
# Check that sfdx force:source:status is clean before committing
# Put this into .git/hooks/pre-commit
if ! sfdx force:source:status --json | jq -r '.result | length' | grep '^0$' &> /dev/null;
then
echo "Error: sfdx source is not synced with remote"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment