feat(install,update): thread --summary/-Summary through sync and plugin steps
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
77dab28c9a
commit
0a76bd5e54
4 files changed
+137
-73
No files matched your search
+16
-27
@@ -3,51 +3,40 @@ param(
|
||||
[switch]$DryRun,
|
||||
[ValidateSet('Codex','Claude','Both')][string]$Client,
|
||||
[ValidateSet('Windows','Linux')][string]$Platform,
|
||||
[switch]$UpdatePlugins
|
||||
[switch]$Summary
|
||||
)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$root = Split-Path $PSScriptRoot -Parent
|
||||
. (Join-Path $PSScriptRoot 'lib/plugins.ps1')
|
||||
. (Join-Path $PSScriptRoot 'lib/manifest.ps1')
|
||||
. (Join-Path $PSScriptRoot 'lib/install-targets.ps1')
|
||||
|
||||
$Platform = Read-InstallPlatform -Platform $Platform
|
||||
$platform = $Platform.ToLowerInvariant()
|
||||
$Client = Read-InstallClient -Client $Client
|
||||
|
||||
$homePath = [Environment]::GetFolderPath('UserProfile')
|
||||
if (-not $DryRun -and (Test-AnyManifestPresent (Get-InstallDestinations -HomePath $homePath -Client $Client))) {
|
||||
throw 'Already installed, use the update script.'
|
||||
}
|
||||
|
||||
$buildScript = Join-Path $PSScriptRoot 'build.ps1'
|
||||
& $buildScript
|
||||
if (-not $?) { throw 'Build failed. Installation was not started.' }
|
||||
$generated = Join-Path $root 'generated'
|
||||
if (-not (Test-Path $generated)) { throw 'Generated output is missing after a successful build.' }
|
||||
|
||||
if (-not $Platform) {
|
||||
Write-Output 'Select target platform:'
|
||||
Write-Output '1) Windows'
|
||||
Write-Output '2) Linux'
|
||||
do { $platformSelection = Read-Host 'Selection [1-2]' } while ($platformSelection -notin @('1','2'))
|
||||
$Platform = @{'1'='Windows'; '2'='Linux'}[$platformSelection]
|
||||
}
|
||||
$platform = $Platform.ToLowerInvariant()
|
||||
|
||||
if (-not $Client) {
|
||||
Write-Output 'Select installation target:'
|
||||
Write-Output '1) Codex'
|
||||
Write-Output '2) Claude'
|
||||
Write-Output '3) Both'
|
||||
do { $selection = Read-Host 'Selection [1-3]' } while ($selection -notin @('1','2','3'))
|
||||
$Client = @{'1'='Codex'; '2'='Claude'; '3'='Both'}[$selection]
|
||||
}
|
||||
|
||||
$stamp = Get-Date -Format 'yyyyMMdd-HHmmss'
|
||||
$homePath = [Environment]::GetFolderPath('UserProfile')
|
||||
$shellCommand = 'pwsh -NoProfile -ExecutionPolicy Bypass -File'
|
||||
$windowsShellCommand = 'powershell -NoProfile -ExecutionPolicy Bypass -File'
|
||||
if ([Environment]::OSVersion.Platform -eq [PlatformID]::Win32NT) { $shellCommand = $windowsShellCommand }
|
||||
$targets = @()
|
||||
if ($Client -in @('Codex','Both')) { $targets += @{ Source=(Join-Path $generated "codex-$platform"); Destination=(Join-Path $homePath '.codex') } }
|
||||
if ($Client -in @('Codex','Both')) { $targets += @{ Source=(Join-Path $generated "codex-$platform/skills"); Destination=(Join-Path $homePath '.agents/skills') } }
|
||||
if ($Client -in @('Claude','Both')) { $targets += @{ Source=(Join-Path $generated "claude-$platform"); Destination=(Join-Path $homePath '.claude') } }
|
||||
|
||||
foreach ($item in $targets) {
|
||||
foreach ($item in (Get-InstallTargets -Generated $generated -HomePath $homePath -Platform $platform -Client $Client)) {
|
||||
Sync-ManagedDestination -Source $item.Source -Destination $item.Destination -Stamp $stamp `
|
||||
-AiConfigRoot $item.Destination.Replace('\','/') -ShellCommand $shellCommand -WindowsShellCommand $windowsShellCommand -DryRun:$DryRun
|
||||
-AiConfigRoot $item.Destination.Replace('\','/') -ShellCommand $shellCommand -WindowsShellCommand $windowsShellCommand -DryRun:$DryRun -Summary:$Summary
|
||||
}
|
||||
|
||||
Install-ConfiguredPlugins -RepositoryRoot $root -Client $Client -DryRun:$DryRun -Update:$UpdatePlugins
|
||||
$plugins = Select-ConfiguredPlugins -RepositoryRoot $root -Client $Client -Mode 'Install' -DryRun:$DryRun
|
||||
Install-ConfiguredPlugins -RepositoryRoot $root -Client $Client -DryRun:$DryRun -Summary:$Summary -Entries $plugins.Selected
|
||||
Write-Output ($(if ($DryRun) { 'PASS install dry-run' } else { 'PASS install' }))
|
||||
exit 0
|
||||
Reference in new issue
Block a user