Add a script for installing aliae
This commit is contained in:
parent
53466c856c
commit
d5c45fafc7
3 changed files with 74 additions and 21 deletions
48
scripts/Common/Software/aliae/Main.ps1
Normal file
48
scripts/Common/Software/aliae/Main.ps1
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
param(
|
||||||
|
$Action,
|
||||||
|
[hashtable] $Arguments
|
||||||
|
)
|
||||||
|
|
||||||
|
. "$PSScriptRoot/../PowerShell/Profile.ps1";
|
||||||
|
. "$PSScriptRoot/../../Scripts/Software.ps1";
|
||||||
|
|
||||||
|
Start-SoftwareInstaller @PSBoundParameters `
|
||||||
|
-Configurator {
|
||||||
|
$pathExpression = "`"$($IsWindows ? "`$env:ProgramData" : "/etc")/aliae/aliae.yml`"";
|
||||||
|
$path = & ([scriptblock]::Create($pathExpression));
|
||||||
|
$null = New-Item -Force -ItemType Directory (Split-Path -Parent $path);
|
||||||
|
Copy-Item -Force "$PSScriptRoot/aliae.yml" $path;
|
||||||
|
|
||||||
|
Add-PowerShellProfileStatement `
|
||||||
|
-System `
|
||||||
|
-Category "aliae" `
|
||||||
|
-Script (
|
||||||
|
@(
|
||||||
|
{
|
||||||
|
#aliae
|
||||||
|
},
|
||||||
|
"`$globalPath = $pathExpression",
|
||||||
|
{
|
||||||
|
$userPath = & {
|
||||||
|
if ($env:ALIAE_CONFIG) {
|
||||||
|
$env:ALIAE_CONFIG;
|
||||||
|
} else {
|
||||||
|
"~/.aliae.yaml";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (Test-Path $globalPath) {
|
||||||
|
& ([scriptblock]::Create((aliae init pwsh --config $globalPath)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Test-Path $userPath) {
|
||||||
|
& ([scriptblock]::Create((aliae init pwsh)));
|
||||||
|
}
|
||||||
|
|
||||||
|
& ([scriptblock]::Create((aliae completion powershell)));
|
||||||
|
}
|
||||||
|
) -join [System.Environment]::NewLine)
|
||||||
|
} `
|
||||||
|
-UserConfigurator {
|
||||||
|
Copy-Item -Force "$PSScriptRoot/aliae.yml" ~/.aliae.yaml;
|
||||||
|
};
|
|
@ -1,22 +1,4 @@
|
||||||
alias:
|
alias: []
|
||||||
- name: totsch
|
env: []
|
||||||
value: git
|
|
||||||
env:
|
|
||||||
- name: POSH_THEME
|
|
||||||
value: '{{ if eq .OS "windows" }}{{ .Home }}/Nextcloud/.omp{{ else }}/usr/local/share/oh-my-posh/themes{{ end }}/manuel.omp.json'
|
|
||||||
path: []
|
path: []
|
||||||
script:
|
script: []
|
||||||
- value: |
|
|
||||||
# Profile Files
|
|
||||||
$profileRoot = Split-Path -Parent $PROFILE;
|
|
||||||
$profilePaths = @(
|
|
||||||
"$profileRoot/conf.d/*.ps1",
|
|
||||||
"{{ if eq .OS "windows" }}$env:ProgramData{{ else }}/etc{{ end }}/powershell/conf.d/*.ps1"
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach ($profilePath in $profilePaths) {
|
|
||||||
if (Test-Path $profilePath) {
|
|
||||||
Get-Item $profilePath | ForEach-Object { . $_; };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if: match .Shell "pwsh"
|
|
||||||
|
|
23
scripts/Windows/Software/aliae/Main.ps1
Normal file
23
scripts/Windows/Software/aliae/Main.ps1
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
param (
|
||||||
|
$Action,
|
||||||
|
[hashtable] $Arguments
|
||||||
|
)
|
||||||
|
|
||||||
|
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
|
||||||
|
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
|
||||||
|
|
||||||
|
& {
|
||||||
|
param($Parameters)
|
||||||
|
$base = "$PSScriptRoot/../../../Common/Software/aliae/Main.ps1";
|
||||||
|
|
||||||
|
Start-SoftwareInstaller @Parameters `
|
||||||
|
-Installer {
|
||||||
|
Install-WingetPackage JanDeDobbeleer.Aliae;
|
||||||
|
} `
|
||||||
|
-Configurator {
|
||||||
|
. $base -Action ([InstallerAction]::Configure);
|
||||||
|
} `
|
||||||
|
-UserConfigurator {
|
||||||
|
. $base -Action ([InstallerAction]::ConfigureUser);
|
||||||
|
};
|
||||||
|
} $PSBoundParameters;
|
Loading…
Reference in a new issue