fix(powershell): stop Out-Null swallowing setup-tasks AVAILABLE_DOCS lines - #4188
Open
Noor-ul-ain001 wants to merge 1 commit into
Open
fix(powershell): stop Out-Null swallowing setup-tasks AVAILABLE_DOCS lines#4188Noor-ul-ain001 wants to merge 1 commit into
Noor-ul-ain001 wants to merge 1 commit into
Conversation
…lines
Test-FileExists / Test-DirHasFiles report their line with Write-Output and
ALSO return $true/$false -- both on the Success stream. setup-tasks.ps1's
text-mode branch piped each call to `| Out-Null` to discard the boolean,
which discarded the report line with it, so AVAILABLE_DOCS: printed with
nothing under it:
BEFORE (measured, powershell.exe -NoProfile -File ...):
FEATURE_DIR:...\specs\001-my-feature
TASKS_TEMPLATE:...\tasks-template.md
AVAILABLE_DOCS:
(3 lines)
AFTER:
FEATURE_DIR:...\specs\001-my-feature
TASKS_TEMPLATE:...\tasks-template.md
AVAILABLE_DOCS:
[OK] research.md
[FAIL] data-model.md
[FAIL] contracts/
[FAIL] quickstart.md
(7 lines)
The bash twin (scripts/bash/setup-tasks.sh) lists every document under that
header, so the PowerShell variant silently returned less information for
the same inputs.
Same bug, same fix shape (filter out only the boolean with Where-Object)
as the sibling that was just fixed in check-prerequisites.ps1 (upstream
commit 2b36f0c, PR github#3891) -- this is the unfixed twin call site sharing
the same Test-FileExists/Test-DirHasFiles helpers in common.ps1.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test-FileExists/Test-DirHasFiles(inscripts/powershell/common.ps1) report their status line withWrite-Outputand alsoreturn $true/$false— both land on the PowerShell Success stream.setup-tasks.ps1's text-mode branch piped each call to| Out-Nullto discard the boolean, which discards the whole stream item, report line included:The bash twin (
scripts/bash/setup-tasks.sh) lists every document underAVAILABLE_DOCS:, so the PowerShell variant was silently returning less information for the same project state.This is the exact same bug, same shared helpers, as the one just fixed in the sibling script
check-prerequisites.ps1(commit 2b36f0c, #3891) — same day's fix even documentsTest-FileExists/Test-DirHasFiles's dual-stream behavior in a comment.setup-tasks.ps1calls the identical two helpers the identical way and was left with the identical bug. Fix mirrors that PR exactly: replace| Out-Nullwith| Where-Object { $_ -isnot [bool] }so the report line passes through and only the boolean is dropped.Test plan
test_setup_tasks_ps_text_output_lists_available_docstotests/test_setup_tasks.py(mirrors the PS text-mode test added forcheck-prerequisites.ps1in fix(powershell): stopOut-Nullswallowing the AVAILABLE_DOCS status lines #3891)AVAILABLE_DOCS:printed with no lines under it) and passes with itpytest tests/test_setup_tasks.py— 11 passed, 19 skipped (no pwsh in some environments), 1 pre-existing failure unrelated to this change (test_setup_tasks_ps_core_template_resolved— a JSON-encoding quirk in-Jsonmode under Windows PowerShell 5.1, reproduces identically on unmodifiedupstream/main)scripts/powershell/setup-tasks.ps1stays ASCII-only (0 non-ASCII bytes)🤖 Generated with Claude Code