From 72d49c5a107efdd6a2900183939935f0f6d13d5b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 30 Jul 2018 22:17:33 +0300 Subject: cmd to install code extension --- tools/src/main.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tools/src/main.rs') diff --git a/tools/src/main.rs b/tools/src/main.rs index 7d7b2afc0..84a0cf1b6 100644 --- a/tools/src/main.rs +++ b/tools/src/main.rs @@ -5,6 +5,8 @@ extern crate ron; extern crate tera; extern crate walkdir; extern crate tools; +#[macro_use] +extern crate commandspec; use std::{collections::{HashSet, HashMap}, fs, path::Path}; use clap::{App, Arg, SubCommand}; @@ -29,8 +31,10 @@ fn main() -> Result<()> { ) .subcommand(SubCommand::with_name("gen-kinds")) .subcommand(SubCommand::with_name("gen-tests")) + .subcommand(SubCommand::with_name("install-code")) .get_matches(); match matches.subcommand() { + ("install-code", _) => install_code_extension()?, (name, Some(matches)) => run_gen_command(name, matches.is_present("verify"))?, _ => unreachable!(), } @@ -149,3 +153,19 @@ fn existing_tests(dir: &Path) -> Result> { } Ok(res) } + +fn install_code_extension() -> Result<()> { + execute!(r" +cd code +npm install + ")?; + execute!(r" +cd code +./node_modules/vsce/out/vsce package + ")?; + execute!(r" +cd code +code --install-extension ./libsyntax-rust-0.0.1.vsix + ")?; + Ok(()) +} -- cgit v1.2.3