@@ -32,13 +32,12 @@ install:
32
32
if ! rustup component add rustfmt; then
33
33
cargo install -Z install-upgrade --git https://github.com/rust-lang/rustfmt --bin rustfmt
34
34
fi
35
- if [ "$TRAVIS_OS_NAME" == " linux" ]; then
35
+ if [[ "$TRAVIS_OS_NAME" == linux ] ]; then
36
36
. $HOME/.nvm/nvm.sh
37
37
nvm install stable
38
38
nvm use stable
39
39
npm install remark-cli remark-lint
40
- fi
41
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
40
+ elif [[ "$TRAVIS_OS_NAME" == windows ]]; then
42
41
choco install windows-sdk-10.1
43
42
fi
44
43
fi
@@ -102,32 +101,32 @@ matrix:
102
101
103
102
before_script :
104
103
- |
105
- if [ "$TRAVIS_BRANCH" == "auto" ] || [ "$TRAVIS_BRANCH" == "try" ]; then
106
- pr =$(echo $TRAVIS_COMMIT_MESSAGE | grep -o "#[0-9]*" | head -1 | sed 's/^#//g')
107
- output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$pr " | \
104
+ if [[ "$TRAVIS_BRANCH" == "auto" ]] || [[ "$TRAVIS_BRANCH" == "try" ] ]; then
105
+ PR =$(echo " $TRAVIS_COMMIT_MESSAGE" | grep -o "#[0-9]*" | head -1 | sed 's/^#//g')
106
+ output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR " | \
108
107
python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
109
108
grep "^changelog: " | \
110
109
sed "s/changelog: //g")
111
- if [ -z "$output" ]; then
110
+ if [[ -z "$output" ] ]; then
112
111
echo "ERROR: PR body must contain 'changelog: ...'"
113
112
exit 1
114
- elif [ "$output" = "none" ]; then
113
+ elif [[ "$output" = "none" ] ]; then
115
114
echo "WARNING: changelog is 'none'"
116
115
fi
117
116
fi
118
117
- |
119
118
rm rust-toolchain
120
119
./setup-toolchain.sh
121
120
- |
122
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
121
+ if [[ "$TRAVIS_OS_NAME" == "windows" ] ]; then
123
122
export PATH=$PATH:$(rustc --print sysroot)/bin
124
123
else
125
124
export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
126
125
fi
127
126
128
127
script :
129
128
- |
130
- if [ -z ${INTEGRATION} ]; then
129
+ if [[ -z ${INTEGRATION} ] ]; then
131
130
travis_wait 30 ./ci/base-tests.sh && sleep 5
132
131
else
133
132
./ci/integration-tests.sh && sleep 5
0 commit comments