Skip to content

Commit 26851ee

Browse files
Initialize DNCORE_COMPOSE_ARGS array to prevent unbound variable errors
1 parent 41da667 commit 26851ee

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎scripts/dappnode_install.sh‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ set -Eeuo pipefail
2424
# Required so commands like `dappnode_wireguard` (defined as aliases in `.dappnode_profile`) work.
2525
shopt -s expand_aliases
2626

27+
# Ensure array is always defined (avoid `set -u` edge cases)
28+
DNCORE_COMPOSE_ARGS=()
29+
2730
##############################
2831
# Logging / Errors #
2932
##############################
@@ -657,7 +660,7 @@ add_profile_to_shell() {
657660
dappnode_core_start() {
658661
echo "DAppNode starting..." 2>&1 | tee -a "$LOGFILE"
659662

660-
if [[ ${#DNCORE_COMPOSE_ARGS[@]:-0} -eq 0 ]]; then
663+
if [[ ${#DNCORE_COMPOSE_ARGS[@]} -eq 0 ]]; then
661664
build_dncore_compose_args
662665
fi
663666
[[ ${#DNCORE_COMPOSE_ARGS[@]} -gt 0 ]] || die "No docker-compose-*.yml files found in ${DAPPNODE_CORE_DIR}"

0 commit comments

Comments
 (0)