From eb848fd70f8e576d0c4e61acf26039e8f66066bc Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Fri, 6 Mar 2026 14:11:57 +0100 Subject: [PATCH] databasus: make fetch_and_deploy_from_url accept empty dir Pass an explicit empty second argument when downloading MongoDB tools and update fetch_and_deploy_from_url to default the directory parameter to an empty string. This avoids unset/ambiguous directory handling at the call site and ensures the function has a defined directory variable even when none is provided. --- install/databasus-install.sh | 2 +- misc/tools.func | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install/databasus-install.sh b/install/databasus-install.sh index 136f0fae9..a87c5508f 100644 --- a/install/databasus-install.sh +++ b/install/databasus-install.sh @@ -33,7 +33,7 @@ done # Install MongoDB Database Tools via direct .deb (no APT repo for Debian 13) [[ "$(get_os_info id)" == "ubuntu" ]] && MONGO_DIST="ubuntu2204" || MONGO_DIST="debian12" MONGO_VERSION=$(get_latest_gh_tag "mongodb/mongo-tools" "100." || echo "100.14.1") -fetch_and_deploy_from_url "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-${MONGO_DIST}-x86_64-${MONGO_VERSION}.deb" +fetch_and_deploy_from_url "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-${MONGO_DIST}-x86_64-${MONGO_VERSION}.deb" "" mkdir -p /usr/local/mongodb-database-tools/bin [[ -f /usr/bin/mongodump ]] && ln -sf /usr/bin/mongodump /usr/local/mongodb-database-tools/bin/mongodump [[ -f /usr/bin/mongorestore ]] && ln -sf /usr/bin/mongorestore /usr/local/mongodb-database-tools/bin/mongorestore diff --git a/misc/tools.func b/misc/tools.func index 8cf04858c..cce5f303b 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -7999,7 +7999,7 @@ EOF # ------------------------------------------------------------------------------ function fetch_and_deploy_from_url() { local url="$1" - local directory="$2" + local directory="${2:-}" if [[ -z "$url" ]]; then msg_error "URL parameter is required"