The shemul.json file
Commands, variables and environment presets are defined in shemul.json. The keys added in 2.0.0 are all optional and backward compatible with existing files.
| Key | Scope | Purpose |
|---|---|---|
os | command | Per-OS run override: windows, macos, linux or default. |
bin | top-level | Named per-OS interpreters, used as {{name}} or {{bin.name}}. |
runtime | top-level | Default shell (sh, bash, powershell and so on) when a command sets none. |
shell | command | false for argument-vector exec, or a shell name. |
exec | command | An argument vector to run without a shell. |
needs | command | Commands to run first. Deduplicated and cycle-checked. |
pre / post | command | Run before or after the command. post runs only on success. |
parallel | command | Run this command's needs concurrently. |
runner | command | Dispatch to a plugin runner from shemul.plugins. |
requires | top-level | Minimum Shemul version, for example ">=2.0.0". |
update_check | top-level | Set to false to disable the update notifier. |
Cross-OS, portable commands
{
"bin": { "py": { "windows": "python", "default": "python3" } },
"commands": {
"run": { "run": "{{py}} app.py" },
"open": { "run": "xdg-open .", "os": { "windows": "start .", "macos": "open ." } },
"info": { "run": "echo {{os}}/{{arch}}" }
}
}Task pipelines
{
"commands": {
"install": { "run": "npm ci" },
"lint": { "run": "npm run lint" },
"test": { "run": "npm test", "needs": ["install"] },
"ci": { "run": "echo green", "needs": ["lint", "test"], "parallel": true },
"release": { "run": "npm publish", "pre": ["ci"], "post": ["echo done"] }
}
}The run order is always needs, then pre, then the command, then post. Magic variables need no config: {{os}}, {{arch}}, {{python}}, {{shell}}, {{sep}} and {{home}}.