mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-23 00:02:38 -05:00
* update Travis to build on Trusty for code layout * fix shellcheck replace ! -z by -n * shellcheck: fix -n doesn't work with unquoted arguments * more shellcheck fixes * use bash instead of posix
26 lines
827 B
Bash
Executable File
26 lines
827 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
|
|
echo "Spell check"
|
|
cd $(git rev-parse --show-toplevel)
|
|
|
|
if [[ -n $TRAVIS_PULL_REQUEST_BRANCH ]]; then
|
|
# if on a PR, just analyze the changed files
|
|
echo "TRAVIS PR BRANCH: $TRAVIS_PULL_REQUEST_BRANCH"
|
|
FILES=$(git diff --diff-filter=AM --name-only $(git merge-base HEAD ${TRAVIS_BRANCH}) | tr '\n' ' ' )
|
|
export PATH=${HOME}/osgeo4travis/bin:${PATH}
|
|
elif [[ -n $TRAVIS_COMMIT_RANGE ]]; then
|
|
echo "TRAVIS COMMIT RANGE: $TRAVIS_COMMIT_RANGE"
|
|
FILES=$(git diff --diff-filter=AM --name-only ${TRAVIS_COMMIT_RANGE/.../..} | tr '\n' ' ' )
|
|
export PATH=${HOME}/osgeo4travis/bin:${PATH}
|
|
else
|
|
echo "Running spell test on all files (might take a while)"
|
|
FILES=""
|
|
fi
|
|
|
|
if [[ -n $FILES ]]; then
|
|
DIR=$(git rev-parse --show-toplevel)/scripts/spell_check
|
|
${DIR}/check_spelling.sh -r $FILES
|
|
fi
|