File tree 3 files changed +14
-1
lines changed
3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ Experimental package manager for node.js written in rust.
25
25
- [ ] ` outdated `
26
26
- [ ] ` why `
27
27
- [ ] ` licenses `
28
- - [ ] ` run `
28
+ - [x ] ` run `
29
29
- [x] ` test `
30
30
- [ ] ` exec `
31
31
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ pub enum Subcommands {
20
20
Add ( AddArgs ) ,
21
21
/// Runs a package's "test" script, if one was provided.
22
22
Test ,
23
+ /// Runs a defined package script.
24
+ #[ clap( name = "run" ) ]
25
+ RunScript ( RunScriptArgs ) ,
23
26
}
24
27
25
28
#[ derive( Parser , Debug ) ]
@@ -49,3 +52,9 @@ impl AddArgs {
49
52
}
50
53
}
51
54
}
55
+
56
+ #[ derive( Parser , Debug ) ]
57
+ pub struct RunScriptArgs {
58
+ /// A pre-defined package script.
59
+ pub command : String ,
60
+ }
Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ pub async fn run_commands() -> Result<()> {
35
35
Subcommands :: Test => {
36
36
PackageJson :: from_path ( & package_json_path) ?. execute_command ( "test" ) ?;
37
37
}
38
+ Subcommands :: RunScript ( args) => {
39
+ let command = & args. command ;
40
+ PackageJson :: from_path ( & package_json_path) ?. execute_command ( command) ?;
41
+ }
38
42
}
39
43
40
44
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments