prepare extended functionality
This commit is contained in:
parent
9de91b91e1
commit
d82e28f5d1
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
dist/
|
|
||||||
coverage/
|
coverage/
|
||||||
docs/
|
docs/
|
0
alias.json
Normal file
0
alias.json
Normal file
@ -20,11 +20,13 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/npmci#README",
|
"homepage": "https://gitlab.com/pushrocks/npmci#README",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"npmts": "^5.1.15"
|
"npmts": "^5.1.18"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"beautylog": "^5.0.6",
|
||||||
"commander": "^2.9.0",
|
"commander": "^2.9.0",
|
||||||
"shelljs": "^0.7.0",
|
"shelljs": "^0.7.0",
|
||||||
|
"smartfile": "^3.0.10",
|
||||||
"typings-global": "^1.0.3"
|
"typings-global": "^1.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
33
ts/index.ts
33
ts/index.ts
@ -1,25 +1,30 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import "typings-global"
|
import "typings-global";
|
||||||
let shelljs = require("shelljs");
|
import * as plugins from "./npmci.plugins";
|
||||||
|
|
||||||
let program = require('commander');
|
|
||||||
let cmdValue;
|
|
||||||
let nodeValue;
|
|
||||||
|
|
||||||
program
|
|
||||||
|
let command;
|
||||||
|
let commandOption;
|
||||||
|
|
||||||
|
plugins.commander
|
||||||
.version('0.0.1')
|
.version('0.0.1')
|
||||||
.arguments('<cmd> [node]')
|
.arguments('<cmd> [node]')
|
||||||
.action(function (cmd, node) {
|
.action(function (commandArg, commandOptionArg) {
|
||||||
cmdValue = cmd;
|
command = commandArg;
|
||||||
nodeValue = node;
|
commandOption = commandOptionArg;
|
||||||
});
|
});
|
||||||
|
|
||||||
program.parse(process.argv);
|
plugins.commander.parse(process.argv);
|
||||||
|
|
||||||
if (typeof cmdValue === 'undefined') {
|
if (typeof command === 'undefined') {
|
||||||
console.error('no command given!');
|
console.error('no command given!');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
console.log('command:', cmdValue);
|
|
||||||
console.log('node Version:', nodeValue);
|
switch (command){
|
||||||
shelljs.exec("bash -c \"source /usr/local/nvm/nvm.sh && nvm install "+ nodeValue + " nvm alias default " + nodeValue + "\"");
|
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
3
ts/npmci.install.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export let install = (versionArg) => {
|
||||||
|
if(versionArg = )
|
||||||
|
}
|
4
ts/npmci.plugins.ts
Normal file
4
ts/npmci.plugins.ts
Normal 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
6
ts/npmci.publish.ts
Normal 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
3
ts/npmci.test.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export let test = () => {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user