use std::fs;
use std::path::PathBuf;
fn install_sh() -> String {
let path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../..")
.join("tools/install.sh");
fs::read_to_string(&path).unwrap_or_else(|e| panic!("read {}: {e}", path.display()))
}
#[test]
fn installer_uses_marketplace_qualified_plugin_id() {
let src = install_sh();
let mut checked = 0;
for (lineno, line) in src.lines().enumerate() {
let trimmed = line.trim_start();
let is_plugin_id_cmd = (trimmed.contains("claude plugin update ")
|| trimmed.contains("claude plugin install "))
&& !trimmed.contains("plugin marketplace");
if !is_plugin_id_cmd {
continue;
}
checked += 1;
assert!(
line.contains("teamctl@teamctl"),
"tools/install.sh:{} uses a non-marketplace-qualified plugin id \
— `claude plugin update|install` requires `teamctl@teamctl`, \
the bare `teamctl` form always fails (#298):\n {line}",
lineno + 1
);
}
assert!(
checked >= 2,
"expected to find the plugin update + install invocations in \
tools/install.sh; found {checked} — did the install flow move?"
);
}