2024-08-23 21:44:51 +00:00
|
|
|
. "$PSScriptRoot/Constants.ps1";
|
2024-10-13 13:35:24 +00:00
|
|
|
. "$PSScriptRoot/../powershell/Profile.ps1";
|
2024-11-01 12:12:16 +00:00
|
|
|
. "$PSScriptRoot/../../../lib/Software.ps1";
|
2024-08-23 20:38:28 +00:00
|
|
|
|
2024-09-30 03:00:20 +00:00
|
|
|
Start-SoftwareInstaller @args `
|
2024-08-23 20:38:28 +00:00
|
|
|
-Configurator {
|
2024-09-23 00:10:42 +00:00
|
|
|
param([string] $Name)
|
2024-08-23 21:44:51 +00:00
|
|
|
. "$PSScriptRoot/Constants.ps1";
|
|
|
|
$pathExpression = Get-GlobalConfigExpression;
|
|
|
|
$path = Get-GlobalConfigPath;
|
2024-08-23 20:38:28 +00:00
|
|
|
$null = New-Item -Force -ItemType Directory (Split-Path -Parent $path);
|
|
|
|
Copy-Item -Force "$PSScriptRoot/aliae.yml" $path;
|
|
|
|
|
|
|
|
Add-PowerShellProfileStatement `
|
|
|
|
-System `
|
2024-09-23 00:10:42 +00:00
|
|
|
-Category $Name `
|
2024-08-23 20:38:28 +00:00
|
|
|
-Script (
|
|
|
|
@(
|
|
|
|
{
|
|
|
|
#aliae
|
|
|
|
},
|
|
|
|
"`$globalPath = $pathExpression",
|
|
|
|
{
|
|
|
|
$userPath = & {
|
|
|
|
if ($env:ALIAE_CONFIG) {
|
|
|
|
$env:ALIAE_CONFIG;
|
2024-10-06 19:25:34 +00:00
|
|
|
}
|
|
|
|
else {
|
2024-08-23 20:38:28 +00:00
|
|
|
"~/.aliae.yaml";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
if (Test-Path $globalPath) {
|
2024-08-27 20:35:31 +00:00
|
|
|
$null = & ([scriptblock]::Create((aliae init pwsh --config $globalPath))) *>&1;
|
2024-08-23 20:38:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (Test-Path $userPath) {
|
2024-08-27 20:35:31 +00:00
|
|
|
$null = & ([scriptblock]::Create((aliae init pwsh))) *>&1;
|
2024-08-23 20:38:28 +00:00
|
|
|
}
|
|
|
|
|
2024-08-27 16:55:12 +00:00
|
|
|
aliae completion powershell | Out-String | Invoke-Expression;
|
2024-08-23 20:38:28 +00:00
|
|
|
}
|
|
|
|
) -join [System.Environment]::NewLine)
|
|
|
|
} `
|
|
|
|
-UserConfigurator {
|
2024-09-27 00:45:51 +00:00
|
|
|
param(
|
|
|
|
[hashtable] $Arguments
|
|
|
|
)
|
|
|
|
|
|
|
|
sudo -u $Arguments.Name pwsh -c Copy-Item -Force "$PSScriptRoot/aliae.yml" "~/.aliae.yaml";
|
2024-08-23 20:38:28 +00:00
|
|
|
};
|