Install aliae config using common script

This commit is contained in:
Manuel Thalmann 2024-03-20 17:03:14 +01:00
parent f3eb4ec970
commit 90f85e227d
3 changed files with 9 additions and 13 deletions

View file

@ -0,0 +1,4 @@
#!/bin/pwsh
. "$PSScriptRoot/../powershell/profile.ps1";
Add-PowerShellProfileStatement -Statement "# aliae`naliae init pwsh | Invoke-Expression";

View file

@ -1,9 +1,6 @@
#!/bin/bash #!/bin/bash
SKIP_POWERSHELL=${SKIP_POWERSHELL:-0};
pushd "${BASH_SOURCE%/*}" > /dev/null; pushd "${BASH_SOURCE%/*}" > /dev/null;
. "../../Scripts/is-truthy.sh";
if ! grep "\baliae\b" ~/.bashrc > /dev/null if ! grep "\baliae\b" ~/.bashrc > /dev/null
then then
{ {
@ -13,15 +10,11 @@ then
} >> ~/.bashrc; } >> ~/.bashrc;
fi; fi;
if ! isTruthy "${SKIP_POWERSHELL}" profileFile="$(pwsh -c '$PROFILE')";
then
profileFile="$(pwsh -c '$PROFILE')";
if [ ! -f "$profileFile" ] || ! grep "\baliae\b" "$profileFile" > /dev/null if [ ! -f "$profileFile" ] || ! grep "\baliae\b" "$profileFile" > /dev/null
then then
install -dm755 "$(dirname "$profileFile")"; pwsh "./install.ps1";
echo "aliae init pwsh | Invoke-Expression" >> "$profileFile";
fi;
fi; fi;
echo 'aliae init fish | source' | sudo tee /etc/fish/conf.d/aliae.fish > /dev/null; echo 'aliae init fish | source' | sudo tee /etc/fish/conf.d/aliae.fish > /dev/null;

View file

@ -12,10 +12,9 @@ Set-Content $script (
[string]::Join( [string]::Join(
"`n", "`n",
@( @(
"SKIP_POWERSHELL=1 bash `"$PSScriptRoot/../../../Common/Config/aliae/install.sh`"", "bash `"$PSScriptRoot/../../../Common/Config/aliae/install.sh`"",
"rm ~/.bashrc"))); "rm ~/.bashrc")));
$context.AddPowerShellProfileStatement("# aliae`naliae init pwsh | Invoke-Expression");
Write-Information "Running prepared script"; Write-Information "Running prepared script";
Start-Process -Wait $script; Start-Process -Wait $script;
Remove-Item $script; Remove-Item $script;