Skip to content

fix(init): remove Unix-only stderr redirection from gh label create#835

Open
AntonioGassner wants to merge 1 commit into
mattpocock:mainfrom
AntonioGassner:contrib/windows-gh-label-stderr
Open

fix(init): remove Unix-only stderr redirection from gh label create#835
AntonioGassner wants to merge 1 commit into
mattpocock:mainfrom
AntonioGassner:contrib/windows-gh-label-stderr

Conversation

@AntonioGassner

Copy link
Copy Markdown

Problem

sandcastle init fails on Windows at the "create the Sandcastle GitHub label" step. The gh label create invocation in src/cli.ts ends with a 2>/dev/null stderr redirection — Unix shell syntax that PowerShell and cmd do not understand — so the spawned command errors on Windows hosts.

Fix

Remove the 2>/dev/null. It was redundant: the execSync call already runs with stdio: "ignore", which discards stdout and stderr on every platform. Dropping the redirection is a no-op on macOS/Linux (stderr was already suppressed by stdio: "ignore") and unblocks Windows.

- gh label create "Sandcastle" --description "..." --color "F9A825" 2>/dev/null
+ gh label create "Sandcastle" --description "..." --color "F9A825"

Testing

Verified on macOS:

  • npm run typecheck passes.
  • npm run build succeeds.
  • sandcastle init --issue-tracker github-issues --create-label true still creates the Sandcastle label.
  • Re-running the same init when the label already exists completes normally and no longer prints a noisy gh label error.
  • Confirmed via gh label list --search Sandcastle that the label is created (Sandcastle, "Issues for Sandcastle to work on", #F9A825).

Changeset

Included (patch) — user-facing fix to the init flow.

The `gh label create` call in `sandcastle init` used a `2>/dev/null`
redirection, which is invalid in Windows PowerShell/cmd and causes init
to fail when creating the Sandcastle label. The redirection was redundant
because `execSync` already runs with `stdio: "ignore"`, which discards
stderr on every platform. Removing it makes init work on Windows with no
behavior change on macOS/Linux.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

@AntonioGassner is attempting to deploy a commit to the Matt Pocock's projects Team on Vercel.

A member of the Team first needs to authorize it.

@mattpocock mattpocock added the agent:review Run the automated agent review workflow label Jun 18, 2026
@github-actions github-actions Bot added agent:in-progress Agent workflow is currently running agent:blocked Agent workflow is blocked or failed and removed agent:review Run the automated agent review workflow labels Jun 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

agent:review run failed.

Reason: Branch advanced during review run.

Workflow run: https://github.com/mattpocock/sandcastle/actions/runs/27790452873

Re-add agent:review to retry.

@github-actions github-actions Bot removed the agent:in-progress Agent workflow is currently running label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:blocked Agent workflow is blocked or failed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants