Install aliae config using common script

This commit is contained in:
Manuel Thalmann 2024-03-20 17:03:14 +01:00
parent 142aa56f2f
commit 9fd8f467bd
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
SKIP_POWERSHELL=${SKIP_POWERSHELL:-0};
pushd "${BASH_SOURCE%/*}" > /dev/null;
. "../../Scripts/is-truthy.sh";
if ! grep "\baliae\b" ~/.bashrc > /dev/null
then
{
@ -13,15 +10,11 @@ then
} >> ~/.bashrc;
fi;
if ! isTruthy "${SKIP_POWERSHELL}"
then
profileFile="$(pwsh -c '$PROFILE')";
profileFile="$(pwsh -c '$PROFILE')";
if [ ! -f "$profileFile" ] || ! grep "\baliae\b" "$profileFile" > /dev/null
then
install -dm755 "$(dirname "$profileFile")";
echo "aliae init pwsh | Invoke-Expression" >> "$profileFile";
fi;
if [ ! -f "$profileFile" ] || ! grep "\baliae\b" "$profileFile" > /dev/null
then
pwsh "./install.ps1";
fi;
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(
"`n",
@(
"SKIP_POWERSHELL=1 bash `"$PSScriptRoot/../../../Common/Config/aliae/install.sh`"",
"bash `"$PSScriptRoot/../../../Common/Config/aliae/install.sh`"",
"rm ~/.bashrc")));
$context.AddPowerShellProfileStatement("# aliae`naliae init pwsh | Invoke-Expression");
Write-Information "Running prepared script";
Start-Process -Wait $script;
Remove-Item $script;