Unify metadata checks in verify-rewritemeta.sh

This commit is contained in:
Daniel Martí 2015-09-28 16:52:12 -07:00
parent 993312e22e
commit f9a55cb0af
2 changed files with 10 additions and 14 deletions

View file

@ -1,10 +1,3 @@
#!/bin/sh #!/bin/sh
#
# Simple pre-commit hook to check that there are no errors in the fdroid
# metadata files.
# Redirect output to stderr. ./tools/verify-rewritemeta.sh
exec 1>&2
# If there are metadata errors, print the stack traces and fail.
exec fdroid readmeta

View file

@ -1,15 +1,18 @@
#!/bin/bash #!/bin/bash
# Verify that rewritemeta has been run. # Check that there are no errors in the metadata files and that they are
# formatted correctly.
set -e set -o errexit
set -o nounset
set -o pipefail
# Redirect output to stderr.
exec 1>&2
files=$(fdroid rewritemeta -l) files=$(fdroid rewritemeta -l)
if [[ -n "$files" ]]; then if [[ -n "$files" ]]; then
echo "Run fdroid rewritemeta to fix formatting on these files:" echo "ERROR: Run rewritemeta to fix formatting on these files:"
echo "$files" echo "$files"
exit 1 exit 1
fi fi
exit 0