From bc325631b371f5e4b337d81fac01fd4f0f625801 Mon Sep 17 00:00:00 2001 From: Pierre Paridans Date: Wed, 14 Dec 2022 11:52:52 +0000 Subject: [PATCH] [FIX] web: lint tooling - exit script if cd fails Ref: - https://www.shellcheck.net/wiki/SC2164 closes odoo/odoo#107937 Signed-off-by: Pierre Paridans (app) --- addons/web/tooling/disable.sh | 2 +- addons/web/tooling/enable.sh | 2 +- addons/web/tooling/refresh.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/web/tooling/disable.sh b/addons/web/tooling/disable.sh index f4d40c8fac6..7e43155b2ac 100755 --- a/addons/web/tooling/disable.sh +++ b/addons/web/tooling/disable.sh @@ -2,7 +2,7 @@ community=$(cd -- "$(dirname "$0")" &> /dev/null && cd ../../.. && pwd) disableInDir () { - cd "$1" + cd "$1" || exit git config --unset core.hooksPath rm .eslintignore rm .eslintrc.json diff --git a/addons/web/tooling/enable.sh b/addons/web/tooling/enable.sh index 9726b0f4413..5996ca0eb06 100755 --- a/addons/web/tooling/enable.sh +++ b/addons/web/tooling/enable.sh @@ -8,7 +8,7 @@ if [[ $testRealPath == "" ]]; then fi enableInDir () { - cd "$1" + cd "$1" || exit hooksPath="$(realpath --relative-to=. "$tooling/hooks")" git config core.hooksPath "$hooksPath" cp "$tooling/_eslintignore" .eslintignore diff --git a/addons/web/tooling/refresh.sh b/addons/web/tooling/refresh.sh index 1e1b6cd8f90..0141e0fbda9 100755 --- a/addons/web/tooling/refresh.sh +++ b/addons/web/tooling/refresh.sh @@ -8,7 +8,7 @@ if [[ $testRealPath == "" ]]; then fi refreshInDir () { - cd "$1" + cd "$1" || exit cp "$tooling/_eslintignore" .eslintignore cp "$tooling/_eslintrc.json" .eslintrc.json cp "$tooling/_jsconfig.json" jsconfig.json