mirror of
https://github.com/OthmanAdi/planning-with-files.git
synced 2026-04-26 00:16:01 +03:00
[GH-ISSUE #87] bug: check-complete.ps1 fails to parse — UTF-8 em-dash in comment breaks PowerShell #49
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/planning-with-files#49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @raykuo998 on GitHub (Feb 27, 2026).
Original GitHub issue: https://github.com/OthmanAdi/planning-with-files/issues/87
Description
check-complete.ps1fails to parse on PowerShell due to a UTF-8 em-dash (—, U+2014, bytesE2 80 94) in a comment on line 32:PowerShell's parser chokes on the em-dash and misinterprets the closing
)in the comment as part of the code, producing:The same em-dash exists in
check-complete.shline 34, but bash handles it fine.Reproduction
Environment
check-complete.ps1is UTF-8 encoded (no BOM)Fix
Replace the em-dash with a plain ASCII double-hyphen in
check-complete.ps1line 32:Also worth auditing
init-session.ps1for the same issue.Context
Found while testing #86. The fallback chain (
powershell.exe ... || sh ...) masks this bug since PowerShell fails silently andshtakes over, butcheck-complete.ps1is currently non-functional.@raykuo998 commented on GitHub (Feb 27, 2026):
Full Fix
The em-dash was just the first parse error. Once fixed, PowerShell hits additional parsing failures from special characters inside double-quoted strings:
[planning-with-files]—[is interpreted as array index syntax($COMPLETE/$TOTAL phases complete)—()is interpreted as a subexpression, thenphasesis an unexpected tokenphase(s)— same subexpression issueError after em-dash-only fix
Complete fix
Replace all double-quoted
Write-Hoststrings with single-quoted strings + concatenation:Also replaced em-dashes (
—) with--in comments and output strings.Verified on Windows 11
All scenarios pass after the full fix:
init-session.ps1was also checked — it's clean (no special characters in interpolated strings).