Merge pull request #1854 from YunoHost/fix_helpers

Fix helpers: actually that might be a bad idea to read arguments
This commit is contained in:
Alexandre Aubin 2024-05-27 17:29:02 +02:00 committed by GitHub
commit 06dc3da3f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)