docs(tasks): add bash shebang to conditional-dependencies example#9747
Conversation
…mple The example for 'Conditional Dependencies' uses bash test syntax (`if [ "$1" = ... ]`). Without an explicit shebang, mise runs inline `run` scripts under the platform default inline shell, which is `cmd /c` on Windows. cmd cannot parse bash test syntax, so a verbatim copy of the example fails on Windows with a confusing `'"$1"' was unexpected at this time` error before any argument is even read. Add `#!/usr/bin/env bash` to the example so it is portable across Linux, macOS, and Windows hosts, and add a short note pointing readers toward the `usage` field for richer argument handling.
Greptile SummaryThis documentation-only PR fixes the "Conditional Dependencies" example in
Confidence Score: 5/5Safe to merge — single doc file change with no code or test impact. The change is confined to one documentation file and corrects a real cross-platform failure in the example. The shebang placement inside the TOML triple-quoted string is the established pattern used by the very next example in the same file, confirming it is handled correctly by mise. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "docs(tasks): add bash shebang to archite..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request updates the architecture documentation to include a shebang in task examples, ensuring cross-platform compatibility. It also adds guidance on using the usage field for argument handling. A review comment suggests using relative links instead of site-absolute paths to ensure documentation links function correctly when viewed on GitHub.
| it, mise uses the platform default inline shell (`sh -c` on Unix, | ||
| `cmd /c` on Windows), so the bash `[ ... ]` test would fail to parse on a | ||
| Windows host. For richer argument handling, prefer the | ||
| [`usage` field](/tasks/task-arguments#usage-field) instead of positional |
There was a problem hiding this comment.
The link uses a site-absolute path (/tasks/task-arguments) which will not resolve correctly when viewing the documentation on GitHub. Using a relative link to the markdown file ensures that the link works both on the documentation website and when browsing the repository directly.
| [`usage` field](/tasks/task-arguments#usage-field) instead of positional | |
| [usage field](./task-arguments.md#usage-field) instead of positional |
There was a problem hiding this comment.
Thanks for the review! I'd like to push back on this one — I believe the site-absolute path is actually the established convention in this repo and the suggested change would be inconsistent with the surrounding docs.
A few data points from docs/tasks/:
docs/tasks/toml-tasks.mdalready links to the same target with the same anchor in exactly the form this PR uses:See the Task Arguments page for complete documentation.
docs/tasks/file-tasks.md,docs/tasks/task-configuration.md, anddocs/tasks/toml-tasks.mdall use[Task Arguments](/tasks/task-arguments).- A quick count under
docs/tasks/: 27 site-absolute(/tasks/...)links vs. 0(./xxx.md)links and 1(./xxx#anchor)link.
The docs are published via VitePress to mise.jdx.dev, where site-absolute paths resolve correctly without the .md extension; the live site appears to be the canonical browsing target rather than GitHub's markdown viewer.
Given that, I'd prefer to keep the link in the form used elsewhere in this directory so it stays consistent. Happy to change it if a maintainer prefers the relative-path style — in that case it might be worth converting the other 27 occurrences in the same pass for consistency.
### 🚀 Features - add --inactive option to outdated and upgrade commands for inactive tools by @roele in [#9640](#9640) ### 🐛 Bug Fixes - **(aqua)** resolve bin paths for prefixed v tags by @risu729 in [#9759](#9759) - **(bun)** create bunx alongside bun.exe on Windows install by @JamBalaya56562 in [#9732](#9732) - **(dotnet)** use shared prerelease tool option by @risu729 in [#9720](#9720) - **(node)** use matching node in npm shim by @jdx in [#9749](#9749) - **(task)** resolve bash deterministically on Windows to avoid WSL launcher by @JamBalaya56562 in [#9750](#9750) ### 📚 Documentation - **(secrets)** clarify age strict mode default by @risu729 in [#9737](#9737) - **(tasks)** add bash shebang to conditional-dependencies example by @JamBalaya56562 in [#9747](#9747) - update backend tool option docs by @risu729 in [#9738](#9738) ### 📦 Registry - remove tools with zero users by @jdx in [#9725](#9725) - add scalafmt ([github:scalameta/scalafmt](https://github.com/scalameta/scalafmt)) by @pokir in [#9757](#9757) - remove flarectl by @risu729 in [#9756](#9756) ### Chore - **(release)** strip pre-existing sponsor block before appending canonical one by @jdx in [#9745](#9745) ### New Contributors - @pokir made their first contribution in [#9757](#9757)
Summary
The "Conditional Dependencies" example in
docs/tasks/architecture.mduses bash test syntax inside an inline
runblock:Without a shebang, mise runs the script under the platform default
inline shell —
sh -c -o errexiton Unix,cmd /con Windows.cmdcannot parse[ "$1" = ... ], so a Windows host running thisverbatim fails immediately:
That happens before the conditional is even evaluated, so the example
is essentially non-functional on Windows as written.
This patch adds
#!/usr/bin/env bashto the example so it is portableacross Linux, macOS, and Windows hosts, and follows the recommendation
in
docs/tasks/task-configuration.mdto "use a shebang instead" of the
shellfield.It also adds a short paragraph pointing readers toward the
usagefield for richer argument handling, since positionalparameters in inline
runblocks have subtle cross-platform caveats(see e.g. discussion #9355
about Windows quoting, and the comment at
e2e/tasks/test_task_raw_args:48-50noting that real positional parameters are only guaranteed for
file-based shebang scripts, not inline TOML scripts).
Verification
Reproduced the failing case and the fix on a fresh
mise.tomlonWindows 11 + mise 2026.5.2:
Before (verbatim from current docs, called from PowerShell or bash):
After (with the shebang added):
Existing Linux/macOS behavior is unchanged: the shebang takes
precedence over the platform default inline shell, and bash
behaves the same way the previous example assumed.
Scope
Documentation only. No code or test changes.