{"record":{"id":"730ae8b84bce2dab","repo":"nikivdev/code","slug":"does-not-contain","errorCode":null,"errorMessage":"{} does not contain {}","messagePattern":"(.+?) does not contain (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/external_cli.rs","lineNumber":445,"sourceCode":"        .parent()\n        .unwrap_or_else(|| Path::new(\".\"))\n        .to_path_buf();\n    Ok(ResolvedExternalCliTool {\n        source_root,\n        manifest_path,\n        manifest,\n        resolution,\n        registration_path,\n    })\n}\n\nfn resolve_install_source_paths(path: &Path) -> Result<(PathBuf, PathBuf)> {\n    let meta = fs::metadata(path)\n        .with_context(|| format!(\"failed to read external CLI source {}\", path.display()))?;\n    if meta.is_dir() {\n        let manifest_path = path.join(MANIFEST_NAME);\n        if !manifest_path.is_file() {\n            bail!(\"{} does not contain {}\", path.display(), MANIFEST_NAME);\n        }\n        return Ok((path.to_path_buf(), manifest_path));\n    }\n\n    if meta.is_file() && path.file_name().and_then(|name| name.to_str()) == Some(MANIFEST_NAME) {\n        let source_root = path\n            .parent()\n            .unwrap_or_else(|| Path::new(\".\"))\n            .to_path_buf();\n        return Ok((source_root, path.to_path_buf()));\n    }\n\n    bail!(\n        \"{} must be an external CLI source directory or {} file\",\n        path.display(),\n        MANIFEST_NAME\n    )\n}","sourceCodeStart":427,"sourceCodeEnd":463,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/external_cli.rs#L427-L463","documentation":"`resolve_install_source_paths` accepts either a directory containing a manifest file (`MANIFEST_NAME`) or the manifest file itself. When given a directory with no manifest inside, it bails with this error naming the directory and the expected manifest filename.","triggerScenarios":"Calling `install_external_cli_link` with a source path that `fs::metadata` reports as a directory, but `path.join(MANIFEST_NAME)` is not a regular file.","commonSituations":"Pointing the installer at a repo root that doesn't contain the manifest at its top level; the manifest was deleted or renamed; passing an empty/placeholder directory.","solutions":["Ensure the source directory contains a manifest file named exactly as `MANIFEST_NAME` at its top level.","Alternatively pass the manifest file path directly instead of the directory.","Move/copy the manifest into the directory you are installing from.","Check you didn't point at a parent directory one level above the manifest."],"exampleFix":"// before\ninstaller.install_external_cli_link(Path::new(\"~/src/my-tool/src\"))?;\n// after\ninstaller.install_external_cli_link(Path::new(\"~/src/my-tool\"))?; // contains manifest at root","handlingStrategy":"validation","validationCode":"fn assert_install_source(path: &Path, manifest_name: &str) -> Result<(), String> {\n    let meta = std::fs::metadata(path).map_err(|e| e.to_string())?;\n    if meta.is_dir() {\n        if path.join(manifest_name).is_file() { return Ok(()); }\n        return Err(format!(\"{} lacks {}\", path.display(), manifest_name));\n    }\n    if meta.is_file() && path.file_name().map_or(false, |n| n == manifest_name) { return Ok(()); }\n    Err(format!(\"{} is not a tool source dir or manifest\", path.display()))\n}","typeGuard":null,"tryCatchPattern":"match installer.install_external_cli_link(&src) {\n    Err(e) if e.to_string().contains(\"does not contain\") => {\n        eprintln!(\"{e}; retrying with the manifest file directly\");\n        installer.install_external_cli_link(&src.join(MANIFEST_NAME))\n    }\n    other => other,\n}","preventionTips":["Pass the directory that directly contains the manifest, not a subdirectory.","Or pass the manifest file path itself.","Keep `MANIFEST_NAME` at the tool root; don't nest it.","Check `path.join(MANIFEST_NAME).is_file()` before invoking the installer."],"tags":["external-cli","install","not-found"],"backgroundTag":"missing-manifest-field","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}