use crate::define_tool;
use crate::tools::common::{InstallError, install_via_cargo_install};
fn install_via_cargo(_min_hint: &str) -> Result<(), InstallError> {
install_via_cargo_install("release-plz")
}
define_tool!(RELEASE_PLZ, {
command: "release-plz",
custom_install: install_via_cargo,
depends_on: &["rust"],
});
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn release_plz_only_installs_via_cargo() {
assert_eq!(RELEASE_PLZ.command, "release-plz");
assert!(
RELEASE_PLZ.macos.is_none()
&& RELEASE_PLZ.linux.is_none()
&& RELEASE_PLZ.windows.is_none()
&& RELEASE_PLZ.bsd.is_none(),
"release-plz has no verified first-party PM packaging; \
every platform must route through custom_install (cargo)"
);
assert!(
RELEASE_PLZ.custom_install.is_some(),
"release-plz requires the cargo-install custom path"
);
assert_eq!(
RELEASE_PLZ.depends_on,
Some(&["rust"] as &[&str]),
"release-plz install path shells out to cargo — rust must \
be declared as a dependency so the topo sort installs the \
toolchain first"
);
}
}