diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-02-27 20:45:06 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-02-27 20:54:56 +0000 |
| commit | 574899803179118bcfb36e19a1d015574ca629ec (patch) | |
| tree | 72600d36078f25e3f5b4bde34fb1bb7fb8e9c635 /ci | |
| parent | 1e8f96a075a7e72d5d15c059795abc871bcf5c6a (diff) | |
| download | mullvadvpn-574899803179118bcfb36e19a1d015574ca629ec.tar.xz mullvadvpn-574899803179118bcfb36e19a1d015574ca629ec.zip | |
Use `git diff --exit-code` to simplify the script
Diffstat (limited to 'ci')
| -rw-r--r-- | ci/ci-android-xml.sh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ci/ci-android-xml.sh b/ci/ci-android-xml.sh index bf3b0dc9ae..13684d4b60 100644 --- a/ci/ci-android-xml.sh +++ b/ci/ci-android-xml.sh @@ -20,12 +20,11 @@ function tidy-up-android-xml { # Autoformats Android XML files and returns 0 if no files were actually changed, or 1 if files were changed function tidy-verify-xml { tidy-up-android-xml - if (( $(git diff android/src/main/AndroidManifest.xml android/src/main/res/ | wc -l) > 0 )); then - echo "android/src/main contains files that were changed, XML is not formatted properly" - git diff -- android/src/main/AndroidManifest.xml android/src/main/res - return 1; - else + if git diff --exit-code -- android/src/main/AndroidManifest.xml android/src/main/res; then echo "Android XML files are correctly formatted" return 0; + else + echo "android/src/main contains files that were changed, XML is not formatted properly" + return 1; fi } |
