diff --git a/scripts/lib/action.fish b/scripts/lib/action.fish index c37026f9..cd044b19 100644 --- a/scripts/lib/action.fish +++ b/scripts/lib/action.fish @@ -26,14 +26,13 @@ function runAction -V dir end function runSetupUserAction -V dir - if [ (id -u) -eq 0 ] - set -l cmdline (cat /proc/$fish_pid/cmdline | string split0) + function setupUserAction -V dir -V sudoConfig + if [ (id -u) -eq 0 ] + set -l cmdline (cat /proc/$fish_pid/cmdline | string split0) - if [ -z "$TMUX" ] - tmux new-session $cmdline - else - - function setupUserAction -V dir -V sudoConfig -V cmdline + if [ -z "$TMUX" ] + tmux new-session $cmdline + else source "$dir/settings.fish" set -l sudoConfig "/etc/sudoers.d/PortValhalla" set -l name (getOSConfig setupUser.name) @@ -59,12 +58,11 @@ function runSetupUserAction -V dir rm "$sudoConfig" userdel -rf "$name" end - - runAction setupUserAction $argv + else + $argv uninstallNixPkgs - read -P "setup user action finished. press enter" end - else - $argv end + + runAction setupUserAction $argv end