Use which to determine the existence of cargo-install-update (#82)
This commit is contained in:
@@ -9,8 +9,8 @@ use std::process::Command;
|
|||||||
const EMACS_UPGRADE: &str = include_str!("emacs.el");
|
const EMACS_UPGRADE: &str = include_str!("emacs.el");
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn run_cargo_update(base_dirs: &BaseDirs, terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
|
pub fn run_cargo_update(terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
|
||||||
if let Some(cargo_update) = base_dirs.home_dir().join(".cargo/bin/cargo-install-update").if_exists() {
|
if let Some(cargo_update) = utils::which("cargo-install-update") {
|
||||||
terminal.print_separator("Cargo");
|
terminal.print_separator("Cargo");
|
||||||
|
|
||||||
let success = || -> Result<(), Error> {
|
let success = || -> Result<(), Error> {
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ fn run() -> Result<(), Error> {
|
|||||||
&mut execution_context,
|
&mut execution_context,
|
||||||
)?);
|
)?);
|
||||||
report.push_result(execute(
|
report.push_result(execute(
|
||||||
|terminal| generic::run_cargo_update(&base_dirs, terminal, opt.dry_run),
|
|terminal| generic::run_cargo_update(terminal, opt.dry_run),
|
||||||
&mut execution_context,
|
&mut execution_context,
|
||||||
)?);
|
)?);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user