fix(build): reject unknown tokens beside allowed placeholders
This commit is contained in:
1 parent
a182b9c5c7
commit
55c80ab9de
3 files changed
+19
-2
No files matched your search
+2
-2
@@ -209,8 +209,8 @@ $leftoverPlaceholders = @(Get-ChildItem $output -File -Recurse | ForEach-Object
|
||||
# __AI_CONFIG_ROOT__ is resolved at install time, once the destination is known; it is
|
||||
# expected to remain in generated output. -cmatch keeps this case-sensitive so Python
|
||||
# dunder names (__main__, __name__) in flashbang.sh are not mistaken for placeholders.
|
||||
$content = (Get-Content -LiteralPath $_.FullName -Raw) -replace '__AI_CONFIG_ROOT__|__POWERSHELL_COMMAND__', ''
|
||||
if ($content -cmatch '__[A-Z0-9_]+__' -and $content -notmatch '__CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY__') { $_.FullName }
|
||||
$content = (Get-Content -LiteralPath $_.FullName -Raw) -replace '__AI_CONFIG_ROOT__|__POWERSHELL_COMMAND__|__CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY__', ''
|
||||
if ($content -cmatch '__[A-Z0-9_]+__') { $_.FullName }
|
||||
})
|
||||
if ($leftoverPlaceholders.Count) { throw "Unresolved template placeholders in: $($leftoverPlaceholders -join ', ')" }
|
||||
|
||||
|
||||
Reference in new issue
Block a user