From f54273a745b38526f3bd50d1c3e4254d9ab7d73f Mon Sep 17 00:00:00 2001 From: bryan Date: Thu, 3 Oct 2024 23:47:06 -0400 Subject: [PATCH] Fix variable ordering --- installJRMC | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/installJRMC b/installJRMC index 0c9b19a..3640cd1 100755 --- a/installJRMC +++ b/installJRMC @@ -260,7 +260,8 @@ parse_input() { declare -ga SERVICES CONTAINERS local long_opts short_opts input - # Defaults + declare -g SCRIPT_PATH; SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}") + declare -g SCRIPT_DIR=; SCRIPT_DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")") declare -g \ BUILD_TARGET="$ID" \ REPO_TARGET="$ID" \ @@ -268,13 +269,9 @@ parse_input() { OUTPUT_DIR="$SCRIPT_DIR/output" \ CREATEREPO_WEBROOT="/var/www/jriver" \ USER="${SUDO_USER:-$USER}" - - declare -g SCRIPT_PATH; SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}") - declare -g SCRIPT_DIR=; SCRIPT_DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")") + declare -g HOME; HOME=$(getent passwd "$USER" | cut -d: -f6) - declare -p - # Set some defaults if zero or one arguments are passed if [[ $# -eq 0 && $ID != "unknown" ]]; then debug "Automatically setting --install repo"