S Technologies's Logo

Color

Green
Teal
Indigo
Blue
Purple
Red
Rose

Mode

Light

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.

KeyScopePurpose
oscommandPer-OS run override: windows, macos, linux or default.
bintop-levelNamed per-OS interpreters, used as {{name}} or {{bin.name}}.
runtimetop-levelDefault shell (sh, bash, powershell and so on) when a command sets none.
shellcommandfalse for argument-vector exec, or a shell name.
execcommandAn argument vector to run without a shell.
needscommandCommands to run first. Deduplicated and cycle-checked.
pre / postcommandRun before or after the command. post runs only on success.
parallelcommandRun this command's needs concurrently.
runnercommandDispatch to a plugin runner from shemul.plugins.
requirestop-levelMinimum Shemul version, for example ">=2.0.0".
update_checktop-levelSet to false to disable the update notifier.

Cross-OS, portable commands

json
{
  "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

json
{
  "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}}.