Skip to content

Commit a6cbcad

Browse files
committed
fix: address review feedback on encoding and naming for all ps scripts
1 parent e3e47bd commit a6cbcad

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

scripts/powershell/create-new-feature.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,9 @@ if (-not $DryRun) {
351351
$template = Resolve-Template -TemplateName 'spec-template' -RepoRoot $repoRoot
352352
if ($template -and (Test-Path $template)) {
353353
# Read the template content and write it to the spec file with UTF-8 encoding without BOM
354-
$content = Get-Content -Raw -Path $template
355-
$Utf8NoBom = New-Object System.Text.UTF8Encoding($false)
356-
[System.IO.File]::WriteAllText($specFile, $content, $Utf8NoBom)
354+
$content = Get-Content -Raw -Encoding UTF8 -Path $template
355+
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
356+
[System.IO.File]::WriteAllText($targetPath, $content, $utf8NoBom)
357357
} else {
358358
New-Item -ItemType File -Path $specFile -Force | Out-Null
359359
}

scripts/powershell/setup-plan.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ New-Item -ItemType Directory -Path $paths.FEATURE_DIR -Force | Out-Null
3535
$template = Resolve-Template -TemplateName 'plan-template' -RepoRoot $paths.REPO_ROOT
3636
if ($template -and (Test-Path $template)) {
3737
# Read the template content and write it to the implementation plan file with UTF-8 encoding without BOM
38-
$content = Get-Content -Raw -Path $template
39-
$Utf8NoBom = New-Object System.Text.UTF8Encoding($false)
40-
[System.IO.File]::WriteAllText($paths.IMPL_PLAN, $content, $Utf8NoBom)
38+
# Read the template content as UTF-8 and write it to the implementation plan file with UTF-8 encoding without BOM
39+
$content = Get-Content -Raw -Encoding UTF8 -Path $template
40+
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
41+
[System.IO.File]::WriteAllText($paths.IMPL_PLAN, $content, $utf8NoBom)
4142
Write-Output "Copied plan template to $($paths.IMPL_PLAN)"
4243
} else {
4344
Write-Warning "Plan template not found"

0 commit comments

Comments
 (0)