Skip to content

Commit ee6b59d

Browse files
committed
[Check] Fix shellcheck in Travis CI
1 parent ab96b67 commit ee6b59d

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ matrix:
2727
language: shell
2828
script:
2929
- shellcheck --version
30-
- find . ! -path "./build/*" ! -path "./tools/*"
31-
-type f \( -name "*.sh" \)
32-
-exec shellcheck {} \;
30+
- find . -type f -name "*.sh" -exec shellcheck {} \;
3331

3432
- name: "cmake-format check"
3533
stage: check

docs/user/publish_gh-pages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ sphinx-build -M html source build
1919

2020
# create or use orphaned gh-pages branch
2121
branch_name=gh-pages
22-
if [ $(git branch --list "$branch_name") ]; then
22+
if [ "$(git branch --list "$branch_name")" ]; then
2323
git stash
2424
git checkout $branch_name
2525
git pull origin $branch_name

tools/run_shellcheck.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
IFS=$'\n\t'
5+
6+
###############################################################################
7+
# Run shellcheck on all shell scripts (for usage in CIs)
8+
# If you develop for this project, please use `make shellcheck`.
9+
###############################################################################
10+
11+
cd "$( cd "$(dirname "$0")"; pwd -P )/.."
12+
13+
echo "Run shellcheck on all source files"
14+
find . ! -path "./build/*" -type f -name "*.sh" -exec shellcheck -e SC2010 -e SC2016 {} \+

0 commit comments

Comments
 (0)