get rid of commandspeck

This commit is contained in:
Aleksey Kladov 2018-09-16 02:12:53 +03:00
parent 3993bb4de9
commit 722706fe41
2 changed files with 21 additions and 22 deletions

View file

@ -11,5 +11,4 @@ itertools = "0.7.8"
tera = "0.11" tera = "0.11"
clap = "2.32.0" clap = "2.32.0"
failure = "0.1.1" failure = "0.1.1"
commandspec = "0.10"
heck = "0.3.0" heck = "0.3.0"

View file

@ -5,8 +5,6 @@ extern crate ron;
extern crate tera; extern crate tera;
extern crate tools; extern crate tools;
extern crate walkdir; extern crate walkdir;
#[macro_use]
extern crate commandspec;
extern crate heck; extern crate heck;
use clap::{App, Arg, SubCommand}; use clap::{App, Arg, SubCommand};
@ -15,6 +13,7 @@ use std::{
collections::HashMap, collections::HashMap,
fs, fs,
path::{Path, PathBuf}, path::{Path, PathBuf},
process::Command,
}; };
use tools::{collect_tests, Test}; use tools::{collect_tests, Test};
@ -191,24 +190,25 @@ fn existing_tests(dir: &Path) -> Result<HashMap<String, (PathBuf, Test)>> {
} }
fn install_code_extension() -> Result<()> { fn install_code_extension() -> Result<()> {
execute!(r"cargo install --path crates/server --force")?; run("cargo install --path crates/server --force", ".")?;
execute!( run(r"npm install", "./code")?;
r" run(r"./node_modules/vsce/out/vsce package", "./code")?;
cd code run(r"code --install-extension ./rcf-lsp-0.0.1.vsix", "./code")?;
npm install Ok(())
" }
)?;
execute!( fn run(cmdline: &'static str, dir: &str) -> Result<()> {
r" eprintln!("\nwill run: {}", cmdline);
cd code let manifest_dir = env!("CARGO_MANIFEST_DIR");
./node_modules/vsce/out/vsce package let project_dir = Path::new(manifest_dir).ancestors().nth(2).unwrap().join(dir);
" let mut args = cmdline.split_whitespace();
)?; let exec = args.next().unwrap();
execute!( let status = Command::new(exec)
r" .args(args)
cd code .current_dir(project_dir)
code --install-extension ./rcf-lsp-0.0.1.vsix .status()?;
" if !status.success() {
)?; bail!("`{}` exited with {}", cmdline, status);
}
Ok(()) Ok(())
} }