aboutsummaryrefslogtreecommitdiff
path: root/tools/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-07-30 20:17:33 +0100
committerAleksey Kladov <[email protected]>2018-07-30 20:17:33 +0100
commit72d49c5a107efdd6a2900183939935f0f6d13d5b (patch)
tree7d9a27b0e981d879e81faf4d042d2419625609dc /tools/src
parentac0d8c48f7a277d4a43448fe7dd4279383bc53f0 (diff)
cmd to install code extension
Diffstat (limited to 'tools/src')
-rw-r--r--tools/src/main.rs20
1 files changed, 20 insertions, 0 deletions
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;
5extern crate tera; 5extern crate tera;
6extern crate walkdir; 6extern crate walkdir;
7extern crate tools; 7extern crate tools;
8#[macro_use]
9extern crate commandspec;
8 10
9use std::{collections::{HashSet, HashMap}, fs, path::Path}; 11use std::{collections::{HashSet, HashMap}, fs, path::Path};
10use clap::{App, Arg, SubCommand}; 12use clap::{App, Arg, SubCommand};
@@ -29,8 +31,10 @@ fn main() -> Result<()> {
29 ) 31 )
30 .subcommand(SubCommand::with_name("gen-kinds")) 32 .subcommand(SubCommand::with_name("gen-kinds"))
31 .subcommand(SubCommand::with_name("gen-tests")) 33 .subcommand(SubCommand::with_name("gen-tests"))
34 .subcommand(SubCommand::with_name("install-code"))
32 .get_matches(); 35 .get_matches();
33 match matches.subcommand() { 36 match matches.subcommand() {
37 ("install-code", _) => install_code_extension()?,
34 (name, Some(matches)) => run_gen_command(name, matches.is_present("verify"))?, 38 (name, Some(matches)) => run_gen_command(name, matches.is_present("verify"))?,
35 _ => unreachable!(), 39 _ => unreachable!(),
36 } 40 }
@@ -149,3 +153,19 @@ fn existing_tests(dir: &Path) -> Result<HashSet<Test>> {
149 } 153 }
150 Ok(res) 154 Ok(res)
151} 155}
156
157fn install_code_extension() -> Result<()> {
158 execute!(r"
159cd code
160npm install
161 ")?;
162 execute!(r"
163cd code
164./node_modules/vsce/out/vsce package
165 ")?;
166 execute!(r"
167cd code
168code --install-extension ./libsyntax-rust-0.0.1.vsix
169 ")?;
170 Ok(())
171}