diff options
Diffstat (limited to 'xtask')
-rw-r--r-- | xtask/src/ast_src.rs | 2 | ||||
-rw-r--r-- | xtask/src/codegen/gen_assists_docs.rs | 2 | ||||
-rw-r--r-- | xtask/src/install.rs | 6 | ||||
-rw-r--r-- | xtask/src/lib.rs | 4 | ||||
-rw-r--r-- | xtask/src/not_bash.rs | 2 |
5 files changed, 14 insertions, 2 deletions
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index 2d9ae904b..98d8104e5 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs | |||
@@ -1,3 +1,5 @@ | |||
1 | //! Defines input for code generation process. | ||
2 | |||
1 | pub(crate) struct KindsSrc<'a> { | 3 | pub(crate) struct KindsSrc<'a> { |
2 | pub(crate) punct: &'a [(&'a str, &'a str)], | 4 | pub(crate) punct: &'a [(&'a str, &'a str)], |
3 | pub(crate) keywords: &'a [&'a str], | 5 | pub(crate) keywords: &'a [&'a str], |
diff --git a/xtask/src/codegen/gen_assists_docs.rs b/xtask/src/codegen/gen_assists_docs.rs index 697e830df..6da5ca89e 100644 --- a/xtask/src/codegen/gen_assists_docs.rs +++ b/xtask/src/codegen/gen_assists_docs.rs | |||
@@ -1,3 +1,5 @@ | |||
1 | //! Generates `assists.md` documentation. | ||
2 | |||
1 | use std::{fs, path::Path}; | 3 | use std::{fs, path::Path}; |
2 | 4 | ||
3 | use crate::{ | 5 | use crate::{ |
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}; | |||
4 | 4 | ||
5 | use anyhow::{bail, format_err, Context, Result}; | 5 | use anyhow::{bail, format_err, Context, Result}; |
6 | 6 | ||
7 | use crate::not_bash::{pushd, run}; | 7 | use crate::{ |
8 | not_bash::{pushd, run}, | ||
9 | project_root, | ||
10 | }; | ||
8 | 11 | ||
9 | // Latest stable, feel free to send a PR if this lags behind. | 12 | // Latest stable, feel free to send a PR if this lags behind. |
10 | const REQUIRED_RUST_VERSION: u32 = 41; | 13 | const REQUIRED_RUST_VERSION: u32 = 41; |
@@ -24,6 +27,7 @@ pub struct ServerOpt { | |||
24 | 27 | ||
25 | impl InstallCmd { | 28 | impl InstallCmd { |
26 | pub fn run(self) -> Result<()> { | 29 | pub fn run(self) -> Result<()> { |
30 | let _dir = pushd(project_root()); | ||
27 | let both = self.server.is_some() && self.client.is_some(); | 31 | let both = self.server.is_some() && self.client.is_some(); |
28 | if cfg!(target_os = "macos") { | 32 | if cfg!(target_os = "macos") { |
29 | fix_path_for_mac().context("Fix path for mac")? | 33 | fix_path_for_mac().context("Fix path for mac")? |
diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs index 2bcd76d60..e5da726ac 100644 --- a/xtask/src/lib.rs +++ b/xtask/src/lib.rs | |||
@@ -1,4 +1,6 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! Support library for `cargo xtask` command. |
2 | //! | ||
3 | //! See https://github.com/matklad/cargo-xtask/ | ||
2 | 4 | ||
3 | pub mod not_bash; | 5 | pub mod not_bash; |
4 | pub mod install; | 6 | pub mod install; |
diff --git a/xtask/src/not_bash.rs b/xtask/src/not_bash.rs index d5577cce9..40f706d9f 100644 --- a/xtask/src/not_bash.rs +++ b/xtask/src/not_bash.rs | |||
@@ -1,4 +1,5 @@ | |||
1 | //! A bad shell -- small cross platform module for writing glue code | 1 | //! A bad shell -- small cross platform module for writing glue code |
2 | |||
2 | use std::{ | 3 | use std::{ |
3 | cell::RefCell, | 4 | cell::RefCell, |
4 | env, | 5 | env, |
@@ -130,6 +131,7 @@ impl Env { | |||
130 | } | 131 | } |
131 | 132 | ||
132 | fn pushd(&mut self, dir: PathBuf) { | 133 | fn pushd(&mut self, dir: PathBuf) { |
134 | let dir = self.cwd().join(dir); | ||
133 | self.pushd_stack.push(dir) | 135 | self.pushd_stack.push(dir) |
134 | } | 136 | } |
135 | fn popd(&mut self) { | 137 | fn popd(&mut self) { |