Backwards compatibility with fisher v3 (#55)

This commit is contained in:
Manuel
2022-10-22 11:48:32 +01:00
committed by GitHub
parent fb91e0b540
commit 785bf11300

View File

@@ -88,7 +88,19 @@ pub fn run_fisher(base_dirs: &BaseDirs, run_type: RunType) -> Result<()> {
print_separator("Fisher");
run_type.execute(&fish).args(&["-c", "fisher update"]).check_run()
let version_str = run_type
.execute(&fish)
.args(&["-c", "fisher --version"])
.check_output()?;
debug!("Fisher version: {}", version_str);
if version_str.starts_with("fisher version 3.") {
// v3 - see https://github.com/topgrade-rs/topgrade/pull/37#issuecomment-1283844506
run_type.execute(&fish).args(&["-c", "fisher"]).check_run()
} else {
// v4
run_type.execute(&fish).args(&["-c", "fisher update"]).check_run()
}
}
pub fn run_bashit(ctx: &ExecutionContext) -> Result<()> {