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:
@@ -216,12 +216,15 @@ export -f install_pkg
|
|||||||
install_program() {
|
install_program() {
|
||||||
local url="$1"
|
local url="$1"
|
||||||
local program_name="$2"
|
local program_name="$2"
|
||||||
|
local install_root=""
|
||||||
local install_path=""
|
local install_path=""
|
||||||
|
|
||||||
|
install_root=$(get_install_root "$program_name")
|
||||||
install_path=$(get_install_path "$program_name")
|
install_path=$(get_install_path "$program_name")
|
||||||
|
|
||||||
if [[ ! -e "$install_path" ]]; then
|
if [[ ! -e "$install_path" ]]; then
|
||||||
download_file "$url" "$program_name"
|
download_file "$url" "$program_name"
|
||||||
|
mkdir -p "$install_root"
|
||||||
mv "$MAC_OS_WORK_PATH/$program_name" "$install_path"
|
mv "$MAC_OS_WORK_PATH/$program_name" "$install_path"
|
||||||
chmod 755 "$install_path"
|
chmod 755 "$install_path"
|
||||||
printf "%s\n" "Installed: $program_name."
|
printf "%s\n" "Installed: $program_name."
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ get_install_root() {
|
|||||||
|
|
||||||
case $(get_extension "$file_name") in
|
case $(get_extension "$file_name") in
|
||||||
'')
|
'')
|
||||||
printf "/usr/local/bin";;
|
printf "%s" "$HOME/.local/bin";;
|
||||||
'app')
|
'app')
|
||||||
printf "/Applications";;
|
printf "/Applications";;
|
||||||
'prefPane')
|
'prefPane')
|
||||||
|
|||||||
Reference in New Issue
Block a user