Harden public package installation and release validation
Some checks failed
Release package / package (macos-latest) (push) Has been cancelled
Release package / package (ubuntu-latest) (push) Has been cancelled
Release package / package (windows-latest) (push) Has been cancelled

This commit is contained in:
oliver 2026-10-11 13:32:36 +08:00
parent 9271494b37
commit 9b2166e5b6
41 changed files with 994 additions and 363 deletions

View file

@ -1,21 +1,4 @@
# Link / install presets/netxops into the DSH user agent-presets root.
# Prefer a real directory copy: DSH discovery skips Windows junctions
# (Dirent.isDirectory() is false for reparse points).
$ErrorActionPreference = "Stop"
$RepoRoot = Split-Path -Parent $PSScriptRoot
$Source = Join-Path $RepoRoot "presets\netxops"
$DshHome = if ($env:DSH_HOME) { $env:DSH_HOME } else { Join-Path $env:USERPROFILE ".dsh" }
$TargetParent = Join-Path $DshHome ".agent-presets"
$Target = Join-Path $TargetParent "netxops"
if (-not (Test-Path (Join-Path $Source "agent.cordis.yml"))) {
throw "Missing preset dir: $Source"
}
New-Item -ItemType Directory -Force -Path $TargetParent | Out-Null
if (Test-Path $Target) {
Remove-Item -Recurse -Force $Target
}
Copy-Item -Recurse -Force $Source $Target
Set-Content -Path (Join-Path $Target ".dsh-netxops-managed") -Value ((Get-Date).ToString("o"))
Write-Host "Installed $Target (copy from $Source)"
Write-Host "Open Settings → Agent presets → Custom → Netx Ops (or new session)."
param([ValidatePattern('^[\w-]+$')][string]$Profile = 'desktop')
$ErrorActionPreference = 'Stop'
& node (Join-Path $PSScriptRoot 'install-preset.mjs') --profile $Profile
if ($LASTEXITCODE -ne 0) { throw 'Preset installation failed.' }