From c3db8c0f048cb74b1fb260b099c58ca78f124783 Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Tue, 12 Feb 2019 19:50:00 +0200 Subject: [PATCH] Canonicalize rustup path before checking if its origin (fix #124) --- src/steps/generic.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/steps/generic.rs b/src/steps/generic.rs index 15640153..e44c6ffd 100644 --- a/src/steps/generic.rs +++ b/src/steps/generic.rs @@ -3,6 +3,7 @@ use crate::executor::{CommandExt, RunType}; use crate::terminal::print_separator; use crate::utils::{self, PathExt}; use directories::BaseDirs; +use failure::ResultExt; use std::path::PathBuf; use std::process::Command; @@ -59,7 +60,11 @@ pub fn run_rustup(base_dirs: &BaseDirs, run_type: RunType) -> Result<(), Error> print_separator("rustup"); - if rustup.is_descendant_of(base_dirs.home_dir()) { + if rustup + .canonicalize() + .context(ErrorKind::StepFailed)? + .is_descendant_of(base_dirs.home_dir()) + { run_type.execute(&rustup).args(&["self", "update"]).check_run()?; }