From af2a56012ff49f41ff7bf1ed2acb16fc546af6b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 27 May 2024 17:26:56 +0200 Subject: [PATCH] Fix helpers: actually that might be a bad idea to read arguments as if `source helpers` has no arguments passed, $@ is the main script arguments. --- helpers/helpers | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/helpers/helpers b/helpers/helpers index a0d0fb3a9..b684cf9d8 100644 --- a/helpers/helpers +++ b/helpers/helpers @@ -2,14 +2,8 @@ # Entrypoint for the helpers scripts SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -if [[ -n "${1:-}" ]]; then - # helpers version can be passed as first when sourcing. - YNH_HELPERS_VERSION="$1" -else - # ...or as environment variable set from manifest - # ...or default to 1 - YNH_HELPERS_VERSION=${YNH_HELPERS_VERSION:-1} -fi +# Helpers version can be specified via an environment variable or default to 1. +YNH_HELPERS_VERSION=${YNH_HELPERS_VERSION:-1} # This is a trick to later only restore set -x if it was set when calling this script readonly XTRACE_ENABLE=$(set +o | grep xtrace)