Better support for noroot

This commit is contained in:
Thomas Forgione 2025-05-03 17:08:01 +02:00
parent 806c1d1510
commit d783dfcf77

View File

@ -109,6 +109,11 @@ ask_for_dotfiles() {
} }
ask_for_neovim() { ask_for_neovim() {
if [ $sudo_available -eq 0 ]; then
warn_n "can't install neovim without sudo"
return
fi
yes_no_ask "do you wish to install and configure neovim?" yes_no_ask "do you wish to install and configure neovim?"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
return return
@ -135,6 +140,11 @@ ask_for_rust() {
} }
ask_for_python() { ask_for_python() {
if [ $sudo_available -eq 0 ]; then
warn_n "can't install python without sudo"
return
fi
yes_no_ask "do you wish to install and configure python?" yes_no_ask "do you wish to install and configure python?"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
return return
@ -144,6 +154,11 @@ ask_for_python() {
} }
ask_for_nodejs() { ask_for_nodejs() {
if [ $sudo_available -eq 0 ]; then
warn_n "can't install node without sudo"
return
fi
yes_no_ask "do you wish to install and configure nodejs?" yes_no_ask "do you wish to install and configure nodejs?"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
return return
@ -156,8 +171,12 @@ ask_for_nodejs() {
} }
ask_for_hyprland() { ask_for_hyprland() {
if [ $sudo_available -eq 0 ]; then
return
fi
if [ $has_pacman -ne 1 ]; then if [ $has_pacman -ne 1 ]; then
warn_n "tforgione's installer does not support this os for setting up hyprland" warn_n "can't install hyprland on this OS"
return return
fi fi
@ -309,6 +328,11 @@ run() {
export UPDATE_CHECK=weekly export UPDATE_CHECK=weekly
export UPDATE_CHECK_TYPE=sliding export UPDATE_CHECK_TYPE=sliding
$HOME/.config/dotfiles/bin/update postpone $HOME/.config/dotfiles/bin/update postpone
if [ $sudo_available -eq 0 ]; then
mkdir -p $HOME/.config/dotfiles/.data
touch $HOME/.config/dotfiles/.data/noroot
fi
fi fi
fi fi