TOML-based Tasks
Tasks can also be defined in .mise.toml
files in different ways. This is a more "traditional" method of defining tasks:
toml
[tasks.cleancache]
run = "rm -rf .cache"
hide = true # hide this task from the list
[tasks.clean]
depends = ['cleancache']
run = "cargo clean" # runs as a shell command
[tasks.build]
description = 'Build the CLI'
run = "cargo build"
alias = 'b' # `mise run b`
[tasks.test]
description = 'Run automated tests'
run = [ # multiple commands are run in series
'cargo test',
'./scripts/test-e2e.sh',
]
dir = "{{cwd}}" # run in user's cwd, default is the project's base directory
[tasks.lint]
description = 'Lint with clippy'
env = {RUST_BACKTRACE = '1'} # env vars for the script
# you can specify a multiline script instead of individual commands
run = """
#!/usr/bin/env bash
cargo clippy
"""
[tasks.ci] # only dependencies to be run
description = 'Run CI tasks'
depends = ['build', 'lint', 'test']
[tasks.release]
description = 'Cut a new release'
file = 'scripts/release.sh' # execute an external script