From 8ccaf956118d52b25625d992f7106db5ef0bb04b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 21 Aug 2022 03:23:35 +0000 Subject: [PATCH] fix:(posix) revert complex uses of [[ (bashisms) --- _webi/bootstrap.sh | 4 ++-- _webi/template.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_webi/bootstrap.sh b/_webi/bootstrap.sh index e26b5dc..a8efed9 100644 --- a/_webi/bootstrap.sh +++ b/_webi/bootstrap.sh @@ -182,12 +182,12 @@ __webi_main() { echo "" } - if [ \$# -eq 0 ] || [ "\$1" =~ ^(-V|--version|version)$ ]; then + if [ \$# -eq 0 ] || [[ "\$1" =~ ^(-V|--version|version)$ ]]; then version exit 0 fi - if [ "\$1" =~ ^(-h|--help|help)$ ]; then + if [[ "\$1" =~ ^(-h|--help|help)$ ]]; then usage "\$@" exit 0 fi diff --git a/_webi/template.sh b/_webi/template.sh index be37981..c30527c 100644 --- a/_webi/template.sh +++ b/_webi/template.sh @@ -181,7 +181,7 @@ __bootstrap_webi() { # TODO wget -c --content-disposition "$my_url" set +e my_show_progress="" - if [ $- == *i* ]; then + if [[ $- == *i* ]]; then my_show_progress="--show-progress" fi if ! wget -q $my_show_progress --user-agent="wget $WEBI_UA" -c "$my_url" -O "$my_dl.part"; then @@ -193,7 +193,7 @@ __bootstrap_webi() { # Neither GNU nor BSD curl have sane resume download options, hence we don't bother # TODO curl -fsSL --remote-name --remote-header-name --write-out "$my_url" my_show_progress="-#" - if [ $- == *i* ]; then + if [[ $- == *i* ]]; then my_show_progress="" fi # shellcheck disable=SC2086