From e94e9509ba8abf46c0ac80a3bde44119f34dd38d Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Fri, 4 Oct 2019 13:37:06 +0200 Subject: [PATCH] :art: Use Shellcheck --- Makefile | 2 +- scripts/doc-config.sh | 9 +++++---- tests/sh/plugin.sh | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 05417ad0..06945d36 100644 --- a/Makefile +++ b/Makefile @@ -110,7 +110,7 @@ uninstall: rm ${DESTDIR}/${PREFIX}/bin/${PRG} test: - @bash help/test.sh ${test_dir} + @bash scripts/test.sh ${test_dir} include $(wildcard .d/*.d) include util/intl.mk diff --git a/scripts/doc-config.sh b/scripts/doc-config.sh index 6f197cec..01067a63 100644 --- a/scripts/doc-config.sh +++ b/scripts/doc-config.sh @@ -1,16 +1,17 @@ +#!/bin/bash title() { - TMP=$(head -n 1 $1) + TMP=$(head -n 1 "$1") sed "s/'/\'/" <<< "${TMP:2}" } list_dir() { [[ "$1" == */"assets" ]] && return - for a in $1/* + for a in "$1"/* do if [ -d "$a" ] then [[ "$a" == */"assets" ]] || - echo "$2- '$(basename $a | sed 's/[0-9][0-9]_//' | sed 's/_/ /g' | sed 's/-/ /g')':"; list_dir "$a" "$2 " - else echo "$a" | grep "\.md$" >/dev/null && echo "$2- '$(title $a)': ${a:5}" + echo "$2- '$(basename "$a" | sed 's/[0-9][0-9]_//' | sed 's/_/ /g' | sed 's/-/ /g')':"; list_dir "$a" "$2" + else echo "$a" | grep "\.md$" >/dev/null && echo "$2- '$(title "$a")': ${a:5}" fi done } diff --git a/tests/sh/plugin.sh b/tests/sh/plugin.sh index 93616113..561efb61 100644 --- a/tests/sh/plugin.sh +++ b/tests/sh/plugin.sh @@ -38,7 +38,7 @@ rm "empty.so" BASE_DIR="$PWD" cd tests/import || exit for test_file in *.c -do test_plugin "$(basename $test_file .c)" +do test_plugin "$(basename "$test_file" .c)" done DRIVER="driver_test:arg" test_plugin driver -- 2.43.0