From d783dfcf77046fd4b32d2b2897762e9da3451f9a Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Sat, 3 May 2025 17:08:01 +0200 Subject: [PATCH] Better support for noroot --- tforgione.sh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tforgione.sh b/tforgione.sh index 6656e48..15600ff 100755 --- a/tforgione.sh +++ b/tforgione.sh @@ -109,6 +109,11 @@ ask_for_dotfiles() { } 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?" if [ $? -ne 0 ]; then return @@ -135,6 +140,11 @@ ask_for_rust() { } 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?" if [ $? -ne 0 ]; then return @@ -144,6 +154,11 @@ ask_for_python() { } 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?" if [ $? -ne 0 ]; then return @@ -156,8 +171,12 @@ ask_for_nodejs() { } ask_for_hyprland() { + if [ $sudo_available -eq 0 ]; then + return + fi + 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 fi @@ -309,6 +328,11 @@ run() { export UPDATE_CHECK=weekly export UPDATE_CHECK_TYPE=sliding $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