aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_tools/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_tools/src/main.rs')
-rw-r--r--crates/ra_tools/src/main.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/ra_tools/src/main.rs b/crates/ra_tools/src/main.rs
index 285071ea5..846e0223e 100644
--- a/crates/ra_tools/src/main.rs
+++ b/crates/ra_tools/src/main.rs
@@ -1,6 +1,5 @@
1use clap::{App, SubCommand}; 1use clap::{App, SubCommand};
2use core::str; 2use core::str;
3use failure::bail;
4use ra_tools::{ 3use ra_tools::{
5 generate, gen_tests, install_format_hook, run, run_with_output, run_rustfmt, 4 generate, gen_tests, install_format_hook, run, run_with_output, run_rustfmt,
6 Overwrite, Result, run_fuzzer, run_clippy, 5 Overwrite, Result, run_fuzzer, run_clippy,
@@ -64,10 +63,8 @@ fn verify_installed_extensions() -> Result<()> {
64 run_with_output(r"code --list-extensions", ".")? 63 run_with_output(r"code --list-extensions", ".")?
65 }; 64 };
66 if !str::from_utf8(&exts.stdout)?.contains("ra-lsp") { 65 if !str::from_utf8(&exts.stdout)?.contains("ra-lsp") {
67 bail!( 66 Err("Could not install the Visual Studio Code extension. Please make sure you \
68 "Could not install the Visual Studio Code extension. Please make sure you \ 67 have at least NodeJS 10.x installed and try again.")?;
69 have at least NodeJS 10.x installed and try again."
70 );
71 } 68 }
72 Ok(()) 69 Ok(())
73} 70}
@@ -79,7 +76,7 @@ fn fix_path_for_mac() -> Result<()> {
79 const ROOT_DIR: &str = ""; 76 const ROOT_DIR: &str = "";
80 let home_dir = match env::var("HOME") { 77 let home_dir = match env::var("HOME") {
81 Ok(home) => home, 78 Ok(home) => home,
82 Err(e) => bail!("Failed getting HOME from environment with error: {}.", e), 79 Err(e) => Err(format!("Failed getting HOME from environment with error: {}.", e))?,
83 }; 80 };
84 81
85 [ROOT_DIR, &home_dir] 82 [ROOT_DIR, &home_dir]
@@ -93,7 +90,7 @@ fn fix_path_for_mac() -> Result<()> {
93 if !vscode_path.is_empty() { 90 if !vscode_path.is_empty() {
94 let vars = match env::var_os("PATH") { 91 let vars = match env::var_os("PATH") {
95 Some(path) => path, 92 Some(path) => path,
96 None => bail!("Could not get PATH variable from env."), 93 None => Err("Could not get PATH variable from env.")?,
97 }; 94 };
98 95
99 let mut paths = env::split_paths(&vars).collect::<Vec<_>>(); 96 let mut paths = env::split_paths(&vars).collect::<Vec<_>>();