fix(instructions): refresh startup rule when custom instructions change

This commit is contained in:
Julian lechner committed 2026-10-08 15:16:19 +02:00
1 parent 83091d247a
commit b1170604eb
4 files changed
+166

No files matched your search

+2
View File
@@ -19,5 +19,7 @@ foreach ($target in $(if ($Client -eq 'Both') { @('codex','claude') } else { @($
$path = Join-Path $directory "$target.md"
$prefix = if ((Test-Path -LiteralPath $path) -and (Get-Item -LiteralPath $path).Length -gt 0 -and -not (Get-Content -LiteralPath $path -Raw).EndsWith([Environment]::NewLine)) { [Environment]::NewLine } else { '' }
[System.IO.File]::AppendAllText($path, $prefix + $Instruction.TrimEnd() + [Environment]::NewLine, [System.Text.UTF8Encoding]::new($false))
& python (Join-Path $root 'scripts/lib/personal_instructions.py') --home $HomePath --client $target
if ($LASTEXITCODE -ne 0) { throw 'Could not refresh the personal instruction rule.' }
Write-Output "Instruction added for $target."
}