Skip to content

fix(justfile): run recipes under PowerShell on Windows#75

Merged
Felipe705x merged 1 commit into
mainfrom
fix/justfile-windows-shell
Jul 5, 2026
Merged

fix(justfile): run recipes under PowerShell on Windows#75
Felipe705x merged 1 commit into
mainfrom
fix/justfile-windows-shell

Conversation

@Felipe705x

Copy link
Copy Markdown
Collaborator

Problem

Every recipe failed on Windows with cargo: command not found:

$ just repl movies.gdb
cargo run --release --bin frogql -- movies.gdb
/bin/bash: line 1: cargo: command not found
error: recipe `repl` failed on line 53 with exit code 127

The justfile pinned set shell := ["bash", "-cu"], routing recipes through Git Bash — whose non-login PATH doesn't include ~/.cargo/bin, so cargo isn't found. (Confirmed: powershell -Command cargo --version → works; bash -cu "cargo --version" → not found.)

Fix

No recipe needs bash any more — the ls | sed | awk test-discovery pipeline was dropped when test became plain cargo test. So run Windows recipes under PowerShell, where cargo resolves:

set shell := ["bash", "-cu"]                                              # macOS/Linux
set windows-shell := ["powershell.exe", "-NoProfile", "-NoLogo", "-Command"]  # Windows

-NoProfile also skips user startup scripts (e.g. a fastfetch banner) so recipe output stays clean.

Also

Reordered the multi-line recipe comments so the line adjacent to each recipe is a clean one-liner — just --list shows only that adjacent line, and the old ordering surfaced mid-sentence fragments like # during tight iteration name the targets you touched... as the description.

Verified locally: just --list renders cleanly and cargo-backed recipes resolve.

🤖 Generated with Claude Code

`set shell := ["bash", "-cu"]` forced every recipe through Git Bash,
whose non-login PATH lacks ~/.cargo/bin — so `just repl`, `just test`,
etc. failed with `cargo: command not found` on Windows. No recipe needs
bash any more (the test discovery pipeline was dropped when `test`
became plain `cargo test`), so add:

  set windows-shell := ["powershell.exe", "-NoProfile", "-NoLogo", "-Command"]

PowerShell resolves cargo from the persistent PATH; -NoProfile skips
user startup scripts. bash stays the shell for macOS/Linux.

Also reorder the multi-line recipe comments so the line adjacent to each
recipe is a clean one-liner — `just --list` only shows that adjacent
line, and the previous ordering surfaced mid-sentence fragments.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Felipe705x Felipe705x merged commit 13f1d79 into main Jul 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant