{"record":{"id":"b8e8f1b30d0bf55b","repo":"jdx/mise","slug":"brew-cask-unsupported-kind-run-command-base","errorCode":null,"errorMessage":"brew-cask:{}: unsupported {kind} run command base {}","messagePattern":"brew-cask:(.+?): unsupported (.+?) run command base (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":5858,"sourceCode":"fn parse_run_command(cask: &Cask, kind: &str, value: Option<&Value>) -> Result<FlightPath> {\n    let object = value.and_then(Value::as_object).ok_or_else(|| {\n        eyre!(\n            \"brew-cask:{}: unsupported {kind} run command metadata format\",\n            cask.token\n        )\n    })?;\n    reject_unsupported_flight_fields(cask, kind, \"run command\", object, &[\"base\", \"path\"])?;\n    let path = object.get(\"path\").and_then(Value::as_str).ok_or_else(|| {\n        eyre!(\n            \"brew-cask:{}: unsupported {kind} run command path\",\n            cask.token\n        )\n    })?;\n    let base = match object.get(\"base\").and_then(Value::as_str) {\n        Some(\"staged_path\") => FlightPathBase::StagedPath,\n        Some(\"appdir\") => FlightPathBase::AppDir,\n        Some(\"homebrew_prefix\") => FlightPathBase::HomebrewPrefix,\n        Some(base) => bail!(\n            \"brew-cask:{}: unsupported {kind} run command base {}\",\n            cask.token,\n            base\n        ),\n        None => FlightPathBase::Literal,\n    };\n    let path_value = Path::new(path);\n    let invalid_absolute_path = base == FlightPathBase::Literal\n        && !path_value.is_absolute()\n        && path_value.components().count() > 1;\n    let invalid_based_path = matches!(\n        base,\n        FlightPathBase::StagedPath | FlightPathBase::AppDir | FlightPathBase::HomebrewPrefix\n    ) && (path_value.is_absolute()\n        || path_value\n            .components()\n            .any(|component| matches!(component, Component::ParentDir)));\n    if invalid_absolute_path || invalid_based_path {","sourceCodeStart":5840,"sourceCodeEnd":5876,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/brew/cask.rs#L5840-L5876","documentation":"Thrown while parsing a run step's command path base. The optional 'base' says where the relative path is anchored: \"staged_path\" (cask extract dir), \"appdir\" (/Applications), \"homebrew_prefix\"; when absent the path is taken literally. Any other base string is rejected.","triggerScenarios":"A run command object {\"path\": \"helper.sh\", \"base\": \"tmpdir\"} — values like \"root\", \"home\", \"caskroom\", or misspellings like \"stagedpath\" all bail with the base echoed in the message.","commonSituations":"Guessing base names instead of checking the enum; Homebrew DSL drift (e.g. expecting :homebrew_caskroom); renaming between versions of the metadata format.","solutions":["Use one of the supported bases: \"staged_path\", \"appdir\", \"homebrew_prefix\"","Or omit \"base\" and give an absolute literal path"],"exampleFix":"// before\n{\"path\": \"Contents/MacOS/install.sh\", \"base\": \"app_dir\"}\n// after\n{\"path\": \"Contents/MacOS/install.sh\", \"base\": \"appdir\"}","handlingStrategy":"validation","validationCode":"fn run_base_ok(cmd: &serde_json::Value) -> bool {\n    match cmd.get(\"base\") {\n        None => true,\n        Some(serde_json::Value::String(s)) => matches!(s.as_str(), \"staged_path\" | \"appdir\" | \"homebrew_prefix\"),\n        Some(_) => false,\n    }\n}","typeGuard":"fn is_supported_run_base(v: &serde_json::Value) -> bool {\n    v.as_str().map(|s| [\"staged_path\", \"appdir\", \"homebrew_prefix\"].contains(&s)).unwrap_or(false)\n}","tryCatchPattern":"match parse_run_command(&cask, kind, Some(&cmd)) {\n    Ok(path) => { /* proceed */ }\n    Err(e) if e.to_string().contains(\"run command base\") => {\n        eprintln!(\"base must be staged_path, appdir, or homebrew_prefix (or omitted)\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Memorize the three run-command bases; there is no 'home' or 'root'","For absolute paths, omit base entirely"],"tags":["brew-cask","mise","run-command","enum-validation","flight-steps"],"backgroundTag":"brew-cask-stanza-validation","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}