mise generate task-stubs
- 用法:
mise generate task-stubs [FLAGS] - 效果: 修改状态
- 源代码:
src/cli/generate/task_stubs.rs
Generate scripts that run mise tasks
Writes one executable stub per task into a directory, such as bin/test for the test task, that runs the task with mise. Pair them with mise generate install-script so contributors can run tasks without installing mise. When a task has subtasks, the parent's stub is written to <parent>/_default.
Hidden tasks and global tasks are skipped: the stubs are committed to the project, and global tasks come from each user's own config.
标志
-d --dir <DIR>— 用于在其中创建任务垫片的目录Default:
bin-m --mise-bin <PATH>— mise executable the stubs run; defaults to mise from PATHUse
--mise-bin ./bin/misewith a script frommise generate install-script. On Windows a path runs as written, so that script needs its.cmdlauncher beside it; generate it withmise generate install-script --write ./bin/mise --windows. The default,mise, is a bare name that resolves from PATH and needs nothing extra.Default:
mise--windows-launcher <KIND>— What to write beside each stub for Windows to launchcmd会写入<task>.cmd。cmd.exe 会在%*展开之前重新解析整行,因此当从 PowerShell 调用启动器时,包含& ^ | " %VAR%的参数无法完整传递给任务。exe则会写入原生的<task>.exe,它从每个 shell 接收的参数都不会发生变化。它是 Windows 构建版本中附带的 mise-shim.exe 的副本,因此只能在 Windows 上生成,并且会为通常会提交到版本控制的目录中的每个任务增加约 220KB。可选值:
cmd、exe默认值:
cmd-h --help— 打印帮助
示例
Write a stub for each task into ./bin
mise generate task-stubsMake the stubs run the mise that mise generate install-script wrote
mise generate task-stubs --mise-bin ./bin/mise