Remove bash profile during installation script

This commit is contained in:
Manuel Thalmann 2024-12-08 04:46:53 +01:00
parent b61602cd68
commit b1ddb0de48

View file

@ -77,9 +77,16 @@ function runSetup
and runHook --force autologin "Please set up a function `autologin` for setting up autologin for the `root` user" and runHook --force autologin "Please set up a function `autologin` for setting up autologin for the `root` user"
and begin and begin
set -l profile "/root/.bash_profile"
begin
set -l profile (string escape "$profile")
set -l tmp (string escape "$profile""_")
set -l script (string escape (getCloneFile (getInstallerScript))) set -l script (string escape (getCloneFile (getInstallerScript)))
wrapScript ( printf "%s\n" \
"mv $profile $tmp" \
(wrapScript (
string join " " \ string join " " \
(begin (begin
for var in \ for var in \
@ -93,9 +100,11 @@ function runSetup
echo "$var=$(string escape "$$var")" echo "$var=$(string escape "$$var")"
end end
end) \ end) \
(string escape $script)) (string escape $script) "&&")) \
"rm $tmp ||"
end | runChroot "$mountDir" tee /root/.bash_profile >/dev/null "mv $tmp $profile"
end | runChroot "$mountDir" tee "$profile" >/dev/null
end
end end
function actionPostRun function actionPostRun