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
This commit is contained in:
Brooke Kuhlmann
2024-07-21 10:59:33 -06:00
parent ecd5ed49a4
commit 005ea19d1c
2 changed files with 4 additions and 1 deletions

View File

@@ -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."

View File

@@ -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')