From 422f62e5f9df058952ac6cf48d4e722e1de64189 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 31 May 2025 11:13:22 +1200 Subject: [PATCH] :-'Generic Commit' --- .../src/install_dropshell_build_requirements.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dropshell-build/src/install_dropshell_build_requirements.sh b/dropshell-build/src/install_dropshell_build_requirements.sh index 0ff12a9..5fc7ea7 100755 --- a/dropshell-build/src/install_dropshell_build_requirements.sh +++ b/dropshell-build/src/install_dropshell_build_requirements.sh @@ -4,8 +4,6 @@ set -euo pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -VERSIONDATE=$(date +%Y.%m%d.%H%M) - # If the user is not root, use sudo SUDOCMD="" [ "$EUID" -eq 0 ] || SUDOCMD="sudo" @@ -16,9 +14,6 @@ if [ -n "${SUDO_USER:-}" ] && [ "$SUDO_USER" != "root" ]; then USER_HOME=$(eval echo "~${SUDO_USER}") fi -VERSION_FILE="$USER_HOME/.config/dropshell-build/version" -mkdir -p "$(dirname "$VERSION_FILE")" - # test sudo is working or we're root (return non-zero if not root!) if ! ${SUDOCMD:-} true; then echo "Error: This script must be run as root or with sudo privileges." >&2 @@ -329,9 +324,13 @@ function main() { install_openssl_musl - echo "$VERSIONDATE" > "$VERSION_FILE" || echo "Error: Failed to write version file" + local VERSIONDATE + local CONFIG_DIR="$USER_HOME/.config/dropshell-build/" + mkdir -p "$CONFIG_DIR" + VERSIONDATE="$(date +%Y.%m%d.%H%M)" + echo "$VERSIONDATE" > "$CONFIG_DIR/version" || echo "Error: Failed to write version file to $CONFIG_DIR/version" echo "Done" } -main "$@" \ No newline at end of file +main "$@"