Skip to content

Commit 7c88005

Browse files
committed
Refactoring
1 parent f5e11cd commit 7c88005

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ci/linkcheck.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
set -e
44
set -o pipefail
55

6+
LINKCHECK_BINARY=mdbook-linkcheck2
7+
68
set_github_token() {
79
jq '.config.output.linkcheck."http-headers"."github\\.com" = ["Authorization: Bearer $GITHUB_TOKEN"]'
810
}
911

1012
if [ ! -z "$SKIP_LINKCHECK" ] ; then
1113
echo "Skipping link check."
12-
exec mdbook-linkcheck -f ""
14+
exec $LINKCHECK_BINARY -f ""
1315
fi
1416

1517
# https://docs.github.com/en/actions/reference/environment-variables
@@ -37,10 +39,10 @@ else # running locally
3739
echo "Checking files changed in $COMMIT_RANGE: $CHANGED_FILES"
3840
fi
3941

40-
echo "exec mdbook-linkcheck2 $FLAGS"
42+
echo "exec $LINKCHECK_BINARY $FLAGS"
4143
if [ "$USE_TOKEN" = 1 ]; then
4244
config=$(set_github_token)
43-
exec mdbook-linkcheck2 $FLAGS <<<"$config"
45+
exec $LINKCHECK_BINARY $FLAGS <<<"$config"
4446
else
45-
exec mdbook-linkcheck2 $FLAGS
47+
exec $LINKCHECK_BINARY $FLAGS
4648
fi

0 commit comments

Comments
 (0)