From 005ea19d1cfd3524fda81d28489c4cc260ec9198 Mon Sep 17 00:00:00 2001 From: Brooke Kuhlmann Date: Sun, 21 Jul 2024 10:59:33 -0600 Subject: [PATCH] Updated install root to use XDG binary path Necessary to ensure user installed binaries are owned by the user that installs rather than default to root access. Milestone: major --- lib/installers.sh | 3 +++ lib/utilities.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/installers.sh b/lib/installers.sh index 5a28bdc..61de5c1 100644 --- a/lib/installers.sh +++ b/lib/installers.sh @@ -216,12 +216,15 @@ export -f install_pkg install_program() { local url="$1" local program_name="$2" + local install_root="" local install_path="" + install_root=$(get_install_root "$program_name") install_path=$(get_install_path "$program_name") if [[ ! -e "$install_path" ]]; then download_file "$url" "$program_name" + mkdir -p "$install_root" mv "$MAC_OS_WORK_PATH/$program_name" "$install_path" chmod 755 "$install_path" printf "%s\n" "Installed: $program_name." diff --git a/lib/utilities.sh b/lib/utilities.sh index 367d499..0128a1d 100644 --- a/lib/utilities.sh +++ b/lib/utilities.sh @@ -89,7 +89,7 @@ get_install_root() { case $(get_extension "$file_name") in '') - printf "/usr/local/bin";; + printf "%s" "$HOME/.local/bin";; 'app') printf "/Applications";; 'prefPane')