add functionality
This commit is contained in:
23
ts/index.ts
23
ts/index.ts
@@ -2,6 +2,9 @@
|
||||
import "typings-global";
|
||||
import * as plugins from "./npmci.plugins";
|
||||
|
||||
import {install} from "./npmci.install";
|
||||
import {test} from "./npmci.test";
|
||||
import {publish} from "./npmci.publish";
|
||||
|
||||
|
||||
let command;
|
||||
@@ -9,10 +12,10 @@ let commandOption;
|
||||
|
||||
plugins.commander
|
||||
.version('0.0.1')
|
||||
.arguments('<cmd> [node]')
|
||||
.action(function (commandArg, commandOptionArg) {
|
||||
command = commandArg;
|
||||
commandOption = commandOptionArg;
|
||||
.arguments('<commandarg> [commandoptionarg]')
|
||||
.action(function (commandarg, commandoptionarg) {
|
||||
command = commandarg;
|
||||
commandOption = commandoptionarg;
|
||||
});
|
||||
|
||||
plugins.commander.parse(process.argv);
|
||||
@@ -24,7 +27,15 @@ if (typeof command === 'undefined') {
|
||||
|
||||
switch (command){
|
||||
case "install":
|
||||
|
||||
install(commandOption);
|
||||
break;
|
||||
case "test":
|
||||
test(commandOption);
|
||||
break;
|
||||
case "publish":
|
||||
publish();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
shelljs.exec("bash -c \"source /usr/local/nvm/nvm.sh && nvm install "+ commandOption + " nvm alias default " + commandOption + "\"");
|
||||
Reference in New Issue
Block a user