From 04e813cd81c4dfeb86c3fbac1ace9a8fd5db870f Mon Sep 17 00:00:00 2001 From: LosslessBot Date: Thu, 26 May 2016 22:17:57 +0200 Subject: [PATCH] initial --- .gitignore | 4 ++++ .npmignore | 2 ++ LICENSE | 2 +- package.json | 30 ++++++++++++++++++++++++++++++ ts/index.ts | 25 +++++++++++++++++++++++++ 5 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .npmignore create mode 100644 package.json create mode 100644 ts/index.ts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..75f5969 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ +coverage/ +docs/ \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..9440aad --- /dev/null +++ b/.npmignore @@ -0,0 +1,2 @@ +docs/ +coverage/ \ No newline at end of file diff --git a/LICENSE b/LICENSE index b249dfc..eb3beb5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Push.Rocks +Copyright (c) 2016 Lossless GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json new file mode 100644 index 0000000..a40f3d2 --- /dev/null +++ b/package.json @@ -0,0 +1,30 @@ +{ + "name": "npmci", + "version": "1.0.0", + "description": "", + "main": "dist/index.js", + "bin": { + "npmci": "dist/index.js" + }, + "scripts": { + "test": "(npmts)" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/pushrocks/npmci.git" + }, + "author": "Lossless GmbH", + "license": "MIT", + "bugs": { + "url": "https://gitlab.com/pushrocks/npmci/issues" + }, + "homepage": "https://gitlab.com/pushrocks/npmci#README", + "devDependencies": { + "npmts": "^5.1.15" + }, + "dependencies": { + "commander": "^2.9.0", + "shelljs": "^0.7.0", + "typings-global": "^1.0.3" + } +} diff --git a/ts/index.ts b/ts/index.ts new file mode 100644 index 0000000..1c0ec1a --- /dev/null +++ b/ts/index.ts @@ -0,0 +1,25 @@ +#!/usr/bin/env node +import "typings-global" +let shelljs = require("shelljs"); + +let program = require('commander'); +let cmdValue; +let nodeValue; + +program + .version('0.0.1') + .arguments(' [node]') + .action(function (cmd, node) { + cmdValue = cmd; + nodeValue = node; + }); + +program.parse(process.argv); + +if (typeof cmdValue === 'undefined') { + console.error('no command given!'); + process.exit(1); +} +console.log('command:', cmdValue); +console.log('node Version:', nodeValue); +shelljs.exec("bash -x \"source /usr/local/nvm/.nvm.sh && nvm install "+ nodeValue); \ No newline at end of file