{"record":{"id":"72dc464fbb7c8f41","repo":"jdx/mise","slug":"brew-cask-kind-terminate-process-name-must-n-72dc46","errorCode":null,"errorMessage":"brew-cask:{}: {kind} terminate_process name must not be empty","messagePattern":"brew-cask:(.+?): (.+?) terminate_process name must not be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/artifacts.rs","lineNumber":807,"sourceCode":"                &[\n                    \"type\",\n                    \"name\",\n                    \"match\",\n                    \"sudo\",\n                    \"attempts\",\n                    \"must_succeed\",\n                    \"notices\",\n                    \"failure_message\",\n                ],\n            )?;\n            let name = object.get(\"name\").and_then(Value::as_str).ok_or_else(|| {\n                eyre!(\n                    \"brew-cask:{}: {kind} terminate_process name must be a string\",\n                    cask.token\n                )\n            })?;\n            if name.is_empty() {\n                bail!(\n                    \"brew-cask:{}: {kind} terminate_process name must not be empty\",\n                    cask.token\n                );\n            }\n            let match_mode = match object.get(\"match\") {\n                None => ProcessMatch::Name,\n                Some(Value::String(value)) if value == \"name\" => ProcessMatch::Name,\n                Some(Value::String(value)) if value == \"full\" => ProcessMatch::Full,\n                _ => bail!(\n                    \"brew-cask:{}: {kind} terminate_process match must be name or full\",\n                    cask.token\n                ),\n            };\n            let sudo = parse_optional_flight_bool(cask, kind, object, \"sudo\", false)?;\n            let must_succeed =\n                parse_optional_flight_bool(cask, kind, object, \"must_succeed\", false)?;\n            let attempts = match object.get(\"attempts\") {\n                None => 1,","sourceCodeStart":789,"sourceCodeEnd":825,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/cask/artifacts.rs#L789-L825","documentation":"Within a cask flight step (`pre`/`post`/uninstall-style `terminate_process` step), the `name` field identifies the process to terminate. If `name` is present but an empty string, parsing fails because an empty process name would match nothing or everything unpredictably. The error includes the cask token and step kind for pinpointing the offending definition.","triggerScenarios":"A `terminate_process` flight step defined with `name = \"\"` in a `pre_flight`/`post_flight` (or uninstall) steps array of a cask.","commonSituations":"Copy-pasting a terminate_process step and forgetting to fill in the process name, or interpolating a variable that resolved to empty.","solutions":["Set `name` to the actual process name, e.g. `name = \"MyApp Helper\"`.","Remove the terminate_process step if no process should be terminated."],"exampleFix":"// before\n[[cask.flight.steps]]\ntype = \"terminate_process\"\nname = \"\"\n// after\n[[cask.flight.steps]]\ntype = \"terminate_process\"\nname = \"MyApp Helper\"","handlingStrategy":"validation","validationCode":"for (const step of flightSteps) {\n  if (step.type === \"terminate_process\" && (typeof step.name !== \"string\" || step.name === \"\"))\n    throw new Error(\"terminate_process name must be a non-empty string\");\n}","typeGuard":"function isNonEmptyString(v) {\n  return typeof v === \"string\" && v.trim().length > 0;\n}","tryCatchPattern":"try {\n  parseCaskArtifacts(cask);\n} catch (err) {\n  if (err.message.includes(\"terminate_process name must not be empty\")) {\n    // fill in the process name for the step/cask named in the message\n  } else throw err;\n}","preventionTips":["Always fill in `name` right after copying a terminate_process step template.","Avoid interpolating possibly-empty variables into process names."],"tags":["brew-cask","config","empty-value"],"backgroundTag":"empty-required-field","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}