aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/src/lib.rs')
-rw-r--r--xtask/src/lib.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs
index cebb14abc..25b64301c 100644
--- a/xtask/src/lib.rs
+++ b/xtask/src/lib.rs
@@ -9,7 +9,7 @@ mod ast_src;
9 9
10use anyhow::Context; 10use anyhow::Context;
11use std::{ 11use std::{
12 env, fs, 12 env,
13 io::Write, 13 io::Write,
14 path::{Path, PathBuf}, 14 path::{Path, PathBuf},
15 process::{Command, Stdio}, 15 process::{Command, Stdio},
@@ -17,7 +17,7 @@ use std::{
17 17
18use crate::{ 18use crate::{
19 codegen::Mode, 19 codegen::Mode,
20 not_bash::{fs2, pushd, run}, 20 not_bash::{fs2, pushd, rm_rf, run},
21}; 21};
22 22
23pub use anyhow::Result; 23pub use anyhow::Result;
@@ -139,7 +139,7 @@ pub fn run_pre_cache() -> Result<()> {
139 } 139 }
140 } 140 }
141 141
142 fs::remove_file("./target/.rustc_info.json")?; 142 fs2::remove_file("./target/.rustc_info.json")?;
143 let to_delete = ["ra_", "heavy_test"]; 143 let to_delete = ["ra_", "heavy_test"];
144 for &dir in ["./target/debug/deps", "target/debug/.fingerprint"].iter() { 144 for &dir in ["./target/debug/deps", "target/debug/.fingerprint"].iter() {
145 for entry in Path::new(dir).read_dir()? { 145 for entry in Path::new(dir).read_dir()? {
@@ -153,11 +153,6 @@ pub fn run_pre_cache() -> Result<()> {
153 Ok(()) 153 Ok(())
154} 154}
155 155
156fn rm_rf(path: &Path) -> Result<()> {
157 if path.is_file() { fs::remove_file(path) } else { fs::remove_dir_all(path) }
158 .with_context(|| format!("failed to remove {:?}", path))
159}
160
161pub fn run_release(dry_run: bool) -> Result<()> { 156pub fn run_release(dry_run: bool) -> Result<()> {
162 if !dry_run { 157 if !dry_run {
163 run!("git switch release")?; 158 run!("git switch release")?;