mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
Make xtask install path-agnostic
This commit is contained in:
parent
9a8329a3a7
commit
520b0c8faf
2 changed files with 6 additions and 1 deletions
|
@ -4,7 +4,10 @@ use std::{env, path::PathBuf, str};
|
||||||
|
|
||||||
use anyhow::{bail, format_err, Context, Result};
|
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.
|
// Latest stable, feel free to send a PR if this lags behind.
|
||||||
const REQUIRED_RUST_VERSION: u32 = 41;
|
const REQUIRED_RUST_VERSION: u32 = 41;
|
||||||
|
@ -24,6 +27,7 @@ pub struct ServerOpt {
|
||||||
|
|
||||||
impl InstallCmd {
|
impl InstallCmd {
|
||||||
pub fn run(self) -> Result<()> {
|
pub fn run(self) -> Result<()> {
|
||||||
|
let _dir = pushd(project_root());
|
||||||
let both = self.server.is_some() && self.client.is_some();
|
let both = self.server.is_some() && self.client.is_some();
|
||||||
if cfg!(target_os = "macos") {
|
if cfg!(target_os = "macos") {
|
||||||
fix_path_for_mac().context("Fix path for mac")?
|
fix_path_for_mac().context("Fix path for mac")?
|
||||||
|
|
|
@ -130,6 +130,7 @@ impl Env {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pushd(&mut self, dir: PathBuf) {
|
fn pushd(&mut self, dir: PathBuf) {
|
||||||
|
let dir = self.cwd().join(dir);
|
||||||
self.pushd_stack.push(dir)
|
self.pushd_stack.push(dir)
|
||||||
}
|
}
|
||||||
fn popd(&mut self) {
|
fn popd(&mut self) {
|
||||||
|
|
Loading…
Reference in a new issue