aboutsummaryrefslogtreecommitdiff
path: root/xtask/src
diff options
context:
space:
mode:
authorSeivan Heidari <[email protected]>2019-11-02 12:43:57 +0000
committerSeivan Heidari <[email protected]>2019-11-02 12:43:57 +0000
commit1d8bb4c6c1fef1f8ea513e07d0a7d4c5483129d2 (patch)
tree055ee515dfaad62af5d2a92bb4ab921a88ee09de /xtask/src
parent1b6c68e51fcbba59c2e99c31d1400cbd6d44f928 (diff)
parenteb8f76a86fe88fcad370577b344f397dd6118cfd (diff)
Merge branch 'master' into feature/themes
Diffstat (limited to 'xtask/src')
-rw-r--r--xtask/src/lib.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs
index cc69463a9..bae4c4650 100644
--- a/xtask/src/lib.rs
+++ b/xtask/src/lib.rs
@@ -3,6 +3,7 @@
3pub mod codegen; 3pub mod codegen;
4 4
5use std::{ 5use std::{
6 env,
6 error::Error, 7 error::Error,
7 fs, 8 fs,
8 io::{Error as IoError, ErrorKind}, 9 io::{Error as IoError, ErrorKind},
@@ -17,7 +18,13 @@ pub type Result<T> = std::result::Result<T, Box<dyn Error>>;
17const TOOLCHAIN: &str = "stable"; 18const TOOLCHAIN: &str = "stable";
18 19
19pub fn project_root() -> PathBuf { 20pub fn project_root() -> PathBuf {
20 Path::new(&env!("CARGO_MANIFEST_DIR")).ancestors().nth(1).unwrap().to_path_buf() 21 Path::new(
22 &env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| env!("CARGO_MANIFEST_DIR").to_owned()),
23 )
24 .ancestors()
25 .nth(1)
26 .unwrap()
27 .to_path_buf()
21} 28}
22 29
23pub struct Cmd<'a> { 30pub struct Cmd<'a> {