Use which to determine the existence of cargo-install-update (#82)

This commit is contained in:
Roey Darwish Dror
2018-11-02 16:31:49 +02:00
parent fde62711d5
commit d2788ea47b
2 changed files with 3 additions and 3 deletions

View File

@@ -9,8 +9,8 @@ use std::process::Command;
const EMACS_UPGRADE: &str = include_str!("emacs.el");
#[must_use]
pub fn run_cargo_update(base_dirs: &BaseDirs, 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() {
pub fn run_cargo_update(terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
if let Some(cargo_update) = utils::which("cargo-install-update") {
terminal.print_separator("Cargo");
let success = || -> Result<(), Error> {

View File

@@ -248,7 +248,7 @@ fn run() -> Result<(), Error> {
&mut execution_context,
)?);
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,
)?);