File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -18,19 +18,30 @@ var request = require("../request");
1818
1919function command ( argv , result ) {
2020 var module = argv . _ [ 1 ] ;
21+ var url = argv . _ [ 2 ] ;
2122 if ( ! module ) {
2223 return result . help ( command ) ;
2324 }
25+
26+ var data = { }
27+ var m = / ^ ( .+ ) @ ( .+ ) $ / . exec ( module ) ;
28+ if ( m ) {
29+ data . module = m [ 1 ] ;
30+ data . version = m [ 2 ]
31+ } else {
32+ data . module = module ;
33+ }
34+ if ( url ) {
35+ data . url = url ;
36+ }
2437 return request . request ( '/nodes' , {
2538 method : "POST" ,
26- data : {
27- module : module
28- }
39+ data : data
2940 } ) . then ( result . logDetails ) . catch ( result . warn ) ;
3041}
3142command . alias = "install" ;
32- command . usage = command . alias + " <module>" ;
33- command . description = "Install the module from NPM " ;
43+ command . usage = command . alias + " <module> [<url>] " ;
44+ command . description = "Install a module. " ;
3445
3546
3647module . exports = command ;
You can’t perform that action at this time.
0 commit comments