Prevent early disposal
This commit is contained in:
parent
3f745ac43d
commit
30601d5e90
1 changed files with 10 additions and 12 deletions
|
@ -28,14 +28,13 @@ end
|
||||||
function runSetupUserAction -V dir
|
function runSetupUserAction -V dir
|
||||||
source "$dir/nix.fish"
|
source "$dir/nix.fish"
|
||||||
|
|
||||||
if [ (id -u) -eq 0 ]
|
function setupUserAction -V dir -V sudoConfig
|
||||||
set -l cmdline (cat /proc/$fish_pid/cmdline | string split0)
|
if [ (id -u) -eq 0 ]
|
||||||
|
set -l cmdline (cat /proc/$fish_pid/cmdline | string split0)
|
||||||
|
|
||||||
if [ -z "$TMUX" ]
|
if [ -z "$TMUX" ]
|
||||||
tmux new-session $cmdline
|
tmux new-session $cmdline
|
||||||
else
|
else
|
||||||
|
|
||||||
function setupUserAction -V dir -V sudoConfig -V cmdline
|
|
||||||
source "$dir/settings.fish"
|
source "$dir/settings.fish"
|
||||||
set -l sudoConfig "/etc/sudoers.d/PortValhalla"
|
set -l sudoConfig "/etc/sudoers.d/PortValhalla"
|
||||||
set -l name (getOSConfig setupUser.name)
|
set -l name (getOSConfig setupUser.name)
|
||||||
|
@ -61,12 +60,11 @@ function runSetupUserAction -V dir
|
||||||
rm "$sudoConfig"
|
rm "$sudoConfig"
|
||||||
userdel -rf "$name"
|
userdel -rf "$name"
|
||||||
end
|
end
|
||||||
|
else
|
||||||
runAction setupUserAction $argv
|
$argv
|
||||||
uninstallNixPkgs
|
uninstallNixPkgs
|
||||||
read -P "setup user action finished. press enter"
|
|
||||||
end
|
end
|
||||||
else
|
|
||||||
$argv
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
runAction setupUserAction $argv
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue