diff --git a/.gitignore b/.gitignore index 75f5969..89dff23 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ node_modules/ -dist/ coverage/ docs/ \ No newline at end of file diff --git a/alias.json b/alias.json new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json index 8331b22..6be2312 100644 --- a/package.json +++ b/package.json @@ -20,11 +20,13 @@ }, "homepage": "https://gitlab.com/pushrocks/npmci#README", "devDependencies": { - "npmts": "^5.1.15" + "npmts": "^5.1.18" }, "dependencies": { + "beautylog": "^5.0.6", "commander": "^2.9.0", "shelljs": "^0.7.0", + "smartfile": "^3.0.10", "typings-global": "^1.0.3" } } diff --git a/ts/index.ts b/ts/index.ts index a27b981..005c756 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -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(' [node]') - .action(function (cmd, node) { - cmdValue = cmd; - nodeValue = node; - }); + +let command; +let commandOption; + +plugins.commander + .version('0.0.1') + .arguments(' [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 + "\""); \ No newline at end of file + +switch (command){ + case "install": + +} + +shelljs.exec("bash -c \"source /usr/local/nvm/nvm.sh && nvm install "+ commandOption + " nvm alias default " + commandOption + "\""); \ No newline at end of file diff --git a/ts/npmci.install.ts b/ts/npmci.install.ts new file mode 100644 index 0000000..a0261c0 --- /dev/null +++ b/ts/npmci.install.ts @@ -0,0 +1,3 @@ +export let install = (versionArg) => { + if(versionArg = ) +} \ No newline at end of file diff --git a/ts/npmci.plugins.ts b/ts/npmci.plugins.ts new file mode 100644 index 0000000..b0ecd33 --- /dev/null +++ b/ts/npmci.plugins.ts @@ -0,0 +1,4 @@ +import "typings-global"; +export import beautylog = require("beautylog"); +export let commander = require("commander"); +export let shelljs = require("shelljs"); \ No newline at end of file diff --git a/ts/npmci.publish.ts b/ts/npmci.publish.ts new file mode 100644 index 0000000..c59d563 --- /dev/null +++ b/ts/npmci.publish.ts @@ -0,0 +1,6 @@ +let npmrcPrefix:string = "//registry.npmjs.org/:_authToken="; +let npmToken:string; + +export let publish = () => { + +}; \ No newline at end of file diff --git a/ts/npmci.test.ts b/ts/npmci.test.ts new file mode 100644 index 0000000..485dec7 --- /dev/null +++ b/ts/npmci.test.ts @@ -0,0 +1,3 @@ +export let test = () => { + +} \ No newline at end of file