jdx/mise · error

brew-cask: command_wrapper requires content or executable, n

Error message

brew-cask: command_wrapper requires content or executable, not both

What it means

Thrown when a command_wrapper artifact specifies BOTH `content` and `executable`. These two options are mutually exclusive: the wrapper either writes inline content or invokes an executable, not both.

Source

Thrown at src/system/packages/brew/cask/artifacts.rs:222

        bail!(
            "brew-cask: command_wrapper has unsupported option {}",
            unsupported.join(", ")
        );
    }
    let content = options
        .get("content")
        .and_then(Value::as_str)
        .map(str::to_string);
    let executable = options
        .get("executable")
        .and_then(Value::as_str)
        .map(str::to_string);
    match (content.is_some(), executable.is_some()) {
        (false, false) => {
            bail!("brew-cask: command_wrapper requires content or executable")
        }
        (true, true) => {
            bail!("brew-cask: command_wrapper requires content or executable, not both")
        }
        _ => {}
    }
    let args = string_args(options, "command_wrapper")?;
    let env = options
        .get("env")
        .map(|env| {
            env.as_object()
                .ok_or_else(|| eyre!("brew-cask: command_wrapper env must be an object"))?
                .iter()
                .map(|(key, value)| {
                    if !is_shell_env_name(key) {
                        bail!("brew-cask: invalid command_wrapper environment name '{key}'");
                    }
                    value
                        .as_str()
                        .map(|value| (key.clone(), value.to_string()))
                        .ok_or_else(|| {

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Remove the `content` option and keep `executable` (plus args/env).
  2. Or remove `executable` (and its args/env) and keep `content` only.

Example fix

// before
["mytool", {"content": "#!/bin/sh\necho hi", "executable": "mytool"}]
// after
["mytool", {"content": "#!/bin/sh\necho hi"}]
Defensive patterns

Strategy: validation

Validate before calling

fn cw_body_exclusive(o: &serde_json::Value) -> bool {
    !(o.get("content").is_some() && o.get("executable").is_some())
}
assert!(cw_body_exclusive(&opts));

Prevention

When it happens

Trigger: A command_wrapper options object containing both a 'content' string and an 'executable' string at the same time.

Common situations: Merging two cask definitions or adding an executable wrapper to an existing content-based one without removing the old option.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/33b6dd312ddba49b. Report an issue: GitHub.