From 520b0c8faf62652e56c9ce3696b4100354e03dc5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 27 Feb 2020 10:54:20 +0100 Subject: Make xtask install path-agnostic --- xtask/src/install.rs | 6 +++++- xtask/src/not_bash.rs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'xtask/src') diff --git a/xtask/src/install.rs b/xtask/src/install.rs index 3df021acc..1d13b26da 100644 --- a/xtask/src/install.rs +++ b/xtask/src/install.rs @@ -4,7 +4,10 @@ use std::{env, path::PathBuf, str}; use anyhow::{bail, format_err, Context, Result}; -use crate::not_bash::{pushd, run}; +use crate::{ + not_bash::{pushd, run}, + project_root, +}; // Latest stable, feel free to send a PR if this lags behind. const REQUIRED_RUST_VERSION: u32 = 41; @@ -24,6 +27,7 @@ pub struct ServerOpt { impl InstallCmd { pub fn run(self) -> Result<()> { + let _dir = pushd(project_root()); let both = self.server.is_some() && self.client.is_some(); if cfg!(target_os = "macos") { fix_path_for_mac().context("Fix path for mac")? diff --git a/xtask/src/not_bash.rs b/xtask/src/not_bash.rs index d5577cce9..c49ad671d 100644 --- a/xtask/src/not_bash.rs +++ b/xtask/src/not_bash.rs @@ -130,6 +130,7 @@ impl Env { } fn pushd(&mut self, dir: PathBuf) { + let dir = self.cwd().join(dir); self.pushd_stack.push(dir) } fn popd(&mut self) { -- cgit v1.2.3