跳转到内容

mise generate task-stubs ​

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 PATH

    Use --mise-bin ./bin/mise with a script from mise generate install-script. On Windows a path runs as written, so that script needs its .cmd launcher beside it; generate it with mise 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 launch

    cmd 会写入 <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-stubs

Make the stubs run the mise that mise generate install-script wrote

mise generate task-stubs --mise-bin ./bin/mise

相关文档 ​