prepare extended functionality

This commit is contained in:
2016-05-29 22:54:59 +02:00
parent 9de91b91e1
commit d82e28f5d1
8 changed files with 43 additions and 21 deletions

View File

@ -1,25 +1,30 @@
#!/usr/bin/env node
import "typings-global"
let shelljs = require("shelljs");
import "typings-global";
import * as plugins from "./npmci.plugins";
let program = require('commander');
let cmdValue;
let nodeValue;
program
.version('0.0.1')
.arguments('<cmd> [node]')
.action(function (cmd, node) {
cmdValue = cmd;
nodeValue = node;
});
let command;
let commandOption;
plugins.commander
.version('0.0.1')
.arguments('<cmd> [node]')
.action(function (commandArg, commandOptionArg) {
command = commandArg;
commandOption = commandOptionArg;
});
program.parse(process.argv);
plugins.commander.parse(process.argv);
if (typeof cmdValue === 'undefined') {
console.error('no command given!');
process.exit(1);
if (typeof command === 'undefined') {
console.error('no command given!');
process.exit(1);
}
console.log('command:', cmdValue);
console.log('node Version:', nodeValue);
shelljs.exec("bash -c \"source /usr/local/nvm/nvm.sh && nvm install "+ nodeValue + " nvm alias default " + nodeValue + "\"");
switch (command){
case "install":
}
shelljs.exec("bash -c \"source /usr/local/nvm/nvm.sh && nvm install "+ commandOption + " nvm alias default " + commandOption + "\"");

3
ts/npmci.install.ts Normal file
View File

@ -0,0 +1,3 @@
export let install = (versionArg) => {
if(versionArg = )
}

4
ts/npmci.plugins.ts Normal file
View File

@ -0,0 +1,4 @@
import "typings-global";
export import beautylog = require("beautylog");
export let commander = require("commander");
export let shelljs = require("shelljs");

6
ts/npmci.publish.ts Normal file
View File

@ -0,0 +1,6 @@
let npmrcPrefix:string = "//registry.npmjs.org/:_authToken=";
let npmToken:string;
export let publish = () => {
};

3
ts/npmci.test.ts Normal file
View File

@ -0,0 +1,3 @@
export let test = () => {
}