Prevent early disposal
This commit is contained in:
parent
2784070e9d
commit
5be51976cc
1 changed files with 10 additions and 12 deletions
|
@ -28,14 +28,13 @@ end
|
|||
function runSetupUserAction -V dir
|
||||
source "$dir/nix.fish"
|
||||
|
||||
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)
|
||||
|
@ -61,12 +60,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
|
||||
|
|
Loading…
Reference in a new issue