mirror of
https://github.com/github/spec-kit.git
synced 2026-07-05 13:34:06 +08:00
fix: correct variable scope in PowerShell deduplication and update docs
- Fix Update-IfNew in PowerShell update-agent-context.ps1 - Changed from $script: scope to Set-Variable -Scope 1 - Properly mutates parent function's local variables - Fixes deduplication tracking for shared AGENTS.md file - Prevents incorrect default Claude file creation - Update create-release-packages.sh documentation - Add missing 'forge' to AGENTS list in header comment - Documentation now matches actual ALL_AGENTS array Without this fix, AGENTS.md would be updated multiple times (once for each agent sharing it: opencode, codex, amp, kiro, bob, pi, forge) and the script would always create a default Claude file even when agent files exist.
This commit is contained in:
@@ -6,7 +6,7 @@ set -euo pipefail
|
||||
# Usage: .github/workflows/scripts/create-release-packages.sh <version>
|
||||
# Version argument should include leading 'v'.
|
||||
# Optionally set AGENTS and/or SCRIPTS env vars to limit what gets built.
|
||||
# AGENTS : space or comma separated subset of: claude gemini copilot cursor-agent qwen opencode windsurf junie codex kilocode auggie roo codebuddy amp shai tabnine kiro-cli agy bob vibe qodercli kimi trae pi iflow generic (default: all)
|
||||
# AGENTS : space or comma separated subset of: claude gemini copilot cursor-agent qwen opencode windsurf junie codex kilocode auggie roo codebuddy amp shai tabnine kiro-cli agy bob vibe qodercli kimi trae pi iflow forge generic (default: all)
|
||||
# SCRIPTS : space or comma separated subset of: sh ps (default: both)
|
||||
# Examples:
|
||||
# AGENTS=claude SCRIPTS=sh $0 v0.2.0
|
||||
|
||||
@@ -447,8 +447,9 @@ function Update-AllExistingAgents {
|
||||
}
|
||||
|
||||
# Record the file as seen before attempting the update
|
||||
$script:updatedPaths += $realPath
|
||||
$script:found = $true
|
||||
# Use parent scope (1) to modify Update-AllExistingAgents' local variables
|
||||
Set-Variable -Name updatedPaths -Value ($updatedPaths + $realPath) -Scope 1
|
||||
Set-Variable -Name found -Value $true -Scope 1
|
||||
|
||||
# Perform the update
|
||||
return (Update-AgentFile -TargetFile $FilePath -AgentName $AgentName)
|
||||
|
||||
Reference in New Issue
Block a user