From 68ddaaff7ce9e64743a4be57c5ffcbbab19048f6 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 27 Nov 2024 05:24:53 +0100 Subject: [PATCH] Preserve `PATH` for setup actions --- scripts/lib/action.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/lib/action.fish b/scripts/lib/action.fish index 87969e77..dc2e3fdb 100644 --- a/scripts/lib/action.fish +++ b/scripts/lib/action.fish @@ -48,7 +48,7 @@ function runSetupUserAction -V dir set -l cmdline (cat /proc/$fish_pid/cmdline | string split0) if [ (id -u) -ne 0 ] - sudo --set-home --preserve-env $cmdline + sudo --set-home --preserve-env env "PATH=$PATH" $cmdline else if [ -z "$TMUX" ] tmux new-session -e "$env" $cmdline @@ -70,7 +70,7 @@ function runSetupUserAction -V dir echo "$name ALL=(ALL:ALL) NOPASSWD: ALL" end >"$sudoConfig" - and sudo --preserve-env --set-home --user "$name" $cmdline + and sudo --preserve-env --set-home --user "$name" env "PATH=$PATH" $cmdline disposeAction rm "$sudoConfig" userdel -rf "$name"