Switch from not_bash to xshell

This commit is contained in:
Aleksey Kladov 2020-10-16 19:46:03 +02:00
parent f0412da4a2
commit 49a90d4c31
14 changed files with 181 additions and 325 deletions

View file

@ -3,15 +3,13 @@ use std::path::{Path, PathBuf};
use quote::quote;
use walkdir::WalkDir;
use xshell::{cmd, read_file};
use crate::{
codegen::{project_root, reformat, update, Mode, Result},
not_bash::{fs2, run},
};
use crate::codegen::{project_root, reformat, update, Mode, Result};
pub fn generate_features(mode: Mode) -> Result<()> {
if !Path::new("./target/rust").exists() {
run!("git clone https://github.com/rust-lang/rust ./target/rust")?;
cmd!("git clone https://github.com/rust-lang/rust ./target/rust").run()?;
}
let contents = generate_descriptor("./target/rust/src/doc/unstable-book/src".into())?;
@ -34,7 +32,7 @@ fn generate_descriptor(src_dir: PathBuf) -> Result<String> {
.map(|entry| {
let path = entry.path();
let feature_ident = path.file_stem().unwrap().to_str().unwrap().replace("-", "_");
let doc = fs2::read_to_string(path).unwrap();
let doc = read_file(path).unwrap();
quote! { LintCompletion { label: #feature_ident, description: #doc } }
});