From eaf7db0851aeb0f234cedfce868b0de2fc58c5ad Mon Sep 17 00:00:00 2001 From: alroba Date: Tue, 30 May 2023 18:39:46 +0200 Subject: [PATCH 1/2] Fix typos in download-customer-package code --- tools/carto-download-customer-package.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/carto-download-customer-package.sh b/tools/carto-download-customer-package.sh index 4fb07e71..4a734c5f 100755 --- a/tools/carto-download-customer-package.sh +++ b/tools/carto-download-customer-package.sh @@ -16,7 +16,7 @@ function check_deps() { for DEP in ${DEPENDENCIES}; do # shellcheck disable=SC2261,SC2210 - command -v "${DEP}" 2&>1 > /dev/null || \ + command -v "${DEP}" 2>&1 > /dev/null || \ { echo -e "\n[ERROR]: missing dependency <${DEP}>. Please, install it.\n"; exit 1;} done } @@ -57,7 +57,7 @@ PROGNAME="$(basename "$0")" # use getopt and store the output into $OPTS # note the use of -o for the short options, --long for the long name options # and a : for any option that takes a parameter -OPTS=$(getopt -o "hd:s" --long "help,dir,selfhosted-mode" -n "$PROGNAME" -- "$@") +OPTS=$(getopt -o "hd:s:" --long "help,dir:,selfhosted-mode:" -n "$PROGNAME" -- "$@") # Check getopt errors # shellcheck disable=SC2166,SC2181 @@ -77,7 +77,7 @@ while true; do case "$1" in -h | --help ) usage; exit; ;; -d | --dir) FILE_DIR="${2%/}"; shift 2 ;; - -s | --selfhosted-mode) SELFHOSTED_MODE="$3"; shift 2 ;; + -s | --selfhosted-mode) SELFHOSTED_MODE="$2"; shift 2 ;; -- ) shift ;; * ) break ;; esac From c982173024d73dc293dcf1023379367a04c73077 Mon Sep 17 00:00:00 2001 From: alvarob <59265195+alroba@users.noreply.github.com> Date: Tue, 30 May 2023 18:59:54 +0200 Subject: [PATCH 2/2] Update carto-download-customer-package.sh Fixed using ShellCheck suggestion: https://www.shellcheck.net/wiki/SC2069 --- tools/carto-download-customer-package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/carto-download-customer-package.sh b/tools/carto-download-customer-package.sh index 4a734c5f..947d9f1a 100755 --- a/tools/carto-download-customer-package.sh +++ b/tools/carto-download-customer-package.sh @@ -16,7 +16,7 @@ function check_deps() { for DEP in ${DEPENDENCIES}; do # shellcheck disable=SC2261,SC2210 - command -v "${DEP}" 2>&1 > /dev/null || \ + command -v "${DEP}" > /dev/null 2>&1 || \ { echo -e "\n[ERROR]: missing dependency <${DEP}>. Please, install it.\n"; exit 1;} done }