ArchSetupScripts/non_pac.sh

35 lines
972 B
Bash
Raw Permalink Normal View History

2024-11-10 13:58:16 +00:00
#!/bin/bash
main(){
2024-11-11 16:02:53 +00:00
if [[ "$(whoami)" != "root" ]];then
bash ./error.sh "Must be root (current: $USER)";
exit 1;
fi
run_non_pac_install;
2024-11-10 13:58:16 +00:00
}
_install_non_pacman(){
local name=$1; local cmd=$2; local post=$3;
if ! command -v "$name" &> /dev/null
then
echo "$name Not installed.. installing";
eval "$cmd"
if [[ "$post" ]]; then
eval "$post"
fi
else
echo "$name already installed";
fi
}
run_non_pac_install(){
echo "########################### Non Pacman #######################"
_install_non_pacman "bun" "curl -fsSL https://bun.sh/install | bash;" # no third arg here
2024-11-10 17:34:37 +00:00
# v--- disabling cause idk what i wanna do with my life atm
#_install_non_pacman "starship" "curl -sS https://starship.rs/install.sh | sh" "echo \"eval \$(starship init bash)\" >> ~/.bashrc"
2024-11-10 13:58:16 +00:00
_install_non_pacman "vim-plug" "curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
}
main;