From ae6cb653f4250a9d4c2f190613241c85b5a1c125 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Wed, 16 Feb 2022 13:52:46 -0800 Subject: [PATCH] man/*sh: fix shellcheck warnings, add to shellcheck Now the only remaining file that needs shellcheck warnings to be fixed is bash-completion. Note that in Makefile's TODO. Signed-off-by: Kir Kolyshkin --- Makefile | 4 ++-- man/md2man-all.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index bc6b80bef..dcceb0b16 100644 --- a/Makefile +++ b/Makefile @@ -133,8 +133,8 @@ cfmt: shellcheck: shellcheck tests/integration/*.bats tests/integration/*.sh \ tests/integration/*.bash tests/*.sh \ - script/* - # TODO: add shellcheck for more sh files + man/*.sh script/* + # TODO: add shellcheck for more sh files (contrib/completions/bash/runc). shfmt: shfmt -ln bats -d -w tests/integration/*.bats diff --git a/man/md2man-all.sh b/man/md2man-all.sh index eaee58ee5..04d9c70a4 100755 --- a/man/md2man-all.sh +++ b/man/md2man-all.sh @@ -2,7 +2,7 @@ set -e # get into this script's directory -cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" +cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" [ "$1" = '-q' ] || { set -x @@ -18,7 +18,7 @@ for FILE in *.md; do base="$(basename "$FILE")" name="${base%.md}" num="${name##*.}" - if [ -z "$num" -o "$name" = "$num" ]; then + if [ -z "$num" ] || [ "$name" = "$num" ]; then # skip files that aren't of the format xxxx.N.md (like README.md) continue fi