chore: fix mise on Windows - #219
Conversation
- Add windows_default_inline_shell_args = "bash -c" so multiline mise tasks run all lines (default cmd /c only ran the first line) - Simplify dev task to single-line (avoids temp-script CRLF shebang bug) - Add [prepare.flutter-deps] with sources/outputs so flutter pub get runs automatically on pubspec.yaml changes but skips when up-to-date - Add .gitattributes forcing LF for *.toml and *.sh (CRLF in toml breaks the bash shell args setting; CRLF in sh breaks shebangs) - Add flutter-dev.pid to .gitignore - Update AGENTS.md and CLAUDE.md: ./bin/mise does not work on Windows, use system mise instead; remove install task docs (replaced by prepare) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR improves cross-platform developer tooling by making mise tasks work reliably on Windows while keeping the existing macOS/Linux workflow intact.
Changes:
- Configure
miseto usebashfor inline task execution on Windows and simplify thedevtask to avoid multiline-script issues. - Replace the manual dependency install task with an automatic
preparestep that runsflutter pub getwhenpubspec.yamlchanges. - Update agent/docs guidance for Windows usage, add LF-enforcing
.gitattributes, and ignore a Flutter dev PID file.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
mise.toml |
Adds Windows inline shell settings and an automatic flutter pub get prepare step. |
mise.dev.toml |
Simplifies the dev task to a single-line command. |
AGENTS.md |
Documents Windows usage and updates dependency guidance to mise prepare. |
CLAUDE.md |
Updates guidance to use system mise on Windows instead of ./bin/mise. |
.gitattributes |
Forces LF line endings for .toml/.sh to avoid Windows CRLF issues. |
.gitignore |
Ignores flutter-dev.pid. |
| # Use bash for inline task scripts on Windows (default is cmd /c which only runs one line) | ||
| windows_default_inline_shell_args = "bash -c" |
There was a problem hiding this comment.
windows_default_inline_shell_args = "bash -c" makes all inline task scripts on Windows depend on bash being available on PATH. If someone runs mise from PowerShell/cmd without Git Bash/WSL installed, tasks will fail immediately. Consider either documenting the bash prerequisite for Windows contributors or switching the Windows inline shell to something guaranteed (e.g. PowerShell).
| # Use bash for inline task scripts on Windows (default is cmd /c which only runs one line) | |
| windows_default_inline_shell_args = "bash -c" | |
| # Use PowerShell for inline task scripts on Windows (default is cmd /c which only runs one line) | |
| windows_default_inline_shell_args = "powershell -NoProfile -Command" |
| | `flutter pub get` | automatic (mise prepare) | Runs automatically on `pubspec.yaml` changes | | ||
| | `dart run build_runner build --delete-conflicting-outputs` | `./bin/mise run generate` | After model changes, before tests | |
There was a problem hiding this comment.
The docs now say flutter pub get runs automatically via mise prepare, but this file still lists the base tasks as including an install task. Since mise.toml removed [tasks.install], please update the “Available: …” list to remove install (or reintroduce the task) so the documentation matches the actual task set.
| # Windows (Git Bash / PowerShell) | ||
| mise run test | ||
| MISE_ENV=dev mise run build:web |
There was a problem hiding this comment.
This section suggests Windows users can run tasks from PowerShell, but mise.toml configures Windows inline task scripts to run via bash -c. That will only work from PowerShell if bash is installed and on PATH (e.g. via Git for Windows). Please clarify the prerequisite (or adjust the guidance) to avoid “bash not found” failures.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
🚀 Cloudflare Pages PreviewYour preview deployment is ready! Preview URL: https://claude-epic-meninsky.staging-cambeerfestival.pages.dev This preview will be automatically updated when you push new commits to this PR. |
Summary
./bin/miseis a Unix-only bootstrap script and does not work on Windows (Git Bash / MINGW64) — AGENTS.md and CLAUDE.md updated to document using systemmiseinsteadwindows_default_inline_shell_args = "bash -c"tomise.toml— without this, mise usescmd /con Windows which only executes the first line of any multiline task scriptdevtask to a single-line run (avoids a separate mise bug where temp script shebangs get `\r` appended when spawned from a native Windows process)[prepare.flutter-deps]soflutter pub getruns automatically whenpubspec.yamlchanges, withoutputsset so it skips when already up-to-date — removes the need for a manualinstalltask.gitattributesforcing LF for*.tomland*.sh— CRLF in TOML breaks thewindows_default_inline_shell_argssetting and CRLF in shell scripts breaks shebangsflutter-dev.pidto.gitignoreTest plan
🤖 Generated with Claude Code