now installing things correctly
This commit is contained in:
parent
9aa9d5b9b9
commit
75399f7ed7
2
README.md
Normal file
2
README.md
Normal file
@ -0,0 +1,2 @@
|
||||
# npmg
|
||||
Install and update global node modules without hassle.
|
9
dist/npmg.install.js
vendored
9
dist/npmg.install.js
vendored
@ -3,7 +3,9 @@ var plugins = require("./npmg.plugins");
|
||||
var paths = require("./npmg.paths");
|
||||
var installExec = function (packageNames) {
|
||||
for (var packageName in packageNames) {
|
||||
plugins.shelljs.exec("npm install -g " + packageName);
|
||||
var execCommand = "npm install -g " + packageNames[packageName];
|
||||
plugins.beautylog.info("now installing " + packageNames[packageName]);
|
||||
plugins.shelljs.exec(execCommand);
|
||||
}
|
||||
;
|
||||
};
|
||||
@ -12,11 +14,12 @@ var install = function (packageSetArg) {
|
||||
switch (packageSetArg) {
|
||||
case "default":
|
||||
installExec(packageLibrary.default);
|
||||
break;
|
||||
default:
|
||||
plugins.beautylog.warn("no set has been specified");
|
||||
break;
|
||||
}
|
||||
installExec(packageLibrary.default);
|
||||
};
|
||||
module.exports = install;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWcuaW5zdGFsbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcsZ0JBQWdCLENBQUMsQ0FBQztBQUMzQyxJQUFPLEtBQUssV0FBVyxjQUFjLENBQUMsQ0FBQztBQUN2QyxJQUFJLFdBQVcsR0FBRyxVQUFTLFlBQXFCO0lBQzVDLEdBQUcsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxXQUFXLElBQUksWUFBWSxDQUFDLENBQUEsQ0FBQztRQUNsQyxPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxpQkFBaUIsR0FBRyxXQUFXLENBQUMsQ0FBQztJQUMxRCxDQUFDO0lBQUEsQ0FBQztBQUNOLENBQUMsQ0FBQ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ICAgIGxldCBleGVjQ29tbWFuZCA9IFwibnBtIGluc3RhbGwgLWcgXCIgKyBwYWNrYWdlTmFtZXNbcGFja2FnZU5hbWVdO1xuICAgICAgICBwbHVnaW5zLmJlYXV0eWxvZy5pbmZvKFwibm93IGluc3RhbGxpbmcgXCIgKyBwYWNrYWdlTmFtZXNbcGFja2FnZU5hbWVdKTtcbiAgICAgICAgcGx1Z2lucy5zaGVsbGpzLmV4ZWMoZXhlY0NvbW1hbmQpO1xuICAgIH07XG59O1xuXG5sZXQgcGFja2FnZUxpYnJhcnkgPSBwbHVnaW5zLnNtYXJ0ZmlsZS5yZWFkRmlsZVRvT2JqZWN0KFxuICAgIHBsdWdpbnMucGF0aC5qb2luKHBhdGhzLnBhY2thZ2VCYXNlLFwicGFja2FnZUxpYnJhcnkuanNvblwiKVxuKTtcblxubGV0IGluc3RhbGwgPSBmdW5jdGlvbihwYWNrYWdlU2V0QXJnOlN0cmluZyl7XG4gICAgc3dpdGNoIChwYWNrYWdlU2V0QXJnKXtcbiAgICAgICAgY2FzZSBcImRlZmF1bHRcIjpcbiAgICAgICAgICAgIGluc3RhbGxFeGVjKHBhY2thZ2VMaWJyYXJ5LmRlZmF1bHQpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICBwbHVnaW5zLmJlYXV0eWxvZy53YXJuKFwibm8gc2V0IGhhcyBiZWVuIHNwZWNpZmllZFwiKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgIH1cbn07XG5cbmV4cG9ydCA9IGluc3RhbGw7Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
|
||||
|
@ -23,11 +23,13 @@
|
||||
},
|
||||
"homepage": "https://github.com/GitZoneTools/npmg#readme",
|
||||
"devDependencies": {
|
||||
"npmts": "^3.3.2"
|
||||
"npmts": "^3.3.2",
|
||||
"smartenv": "^1.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"beautylog": "^3.1.2",
|
||||
"q": "^1.4.1",
|
||||
"shelljs": "^0.6.0",
|
||||
"smartcli": "0.0.11",
|
||||
"smartfile": "0.0.11"
|
||||
}
|
||||
|
19
test/test.js
19
test/test.js
@ -1,2 +1,17 @@
|
||||
var nodeg = require("../dist/index.js");
|
||||
//# sourceMappingURL=test.js.map
|
||||
/// <reference path="../ts/typings/main.d.ts"
|
||||
var npmg = require("../dist/index.js");
|
||||
var smartenv = require("smartenv");
|
||||
var environment = smartenv.getEnv();
|
||||
describe("npmg", function () {
|
||||
describe(".install()", function () {
|
||||
it("should install default list globally when parsed 'default' as argument", function () {
|
||||
if (environment.isC9 || environment.isCI) {
|
||||
this.timeout(60000);
|
||||
npmg.install("default");
|
||||
}
|
||||
;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsOENBQThDO0FBQzlDLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO0FBQ3ZDLElBQUksUUFBUSxHQUFHLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztBQUNuQyxJQUFJLFdBQVcsR0FBRyxRQUFRLENBQUMsTUFBTSxFQUFFLENBQUM7QUFHaEMsUUFBUSxDQUFDLE1BQU0sRUFBQztJQUNaLFFBQVEsQ0FBQyxZQUFZLEVBQUM7UUFDbEIsRUFBRSxDQUFDLHdFQUF3RSxFQUFDO1lBQ3hFLEVBQUUsQ0FBQyxDQUFDLFdBQVcsQ0FBQyxJQUFJLElBQUksV0FBVyxDQUFDLElBQUksQ0FBQyxDQUFBLENBQUM7Z0JBQ3RDLElBQUksQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUM7Z0JBQ3BCLElBQUksQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUM7WUFDNUIsQ0FBQztZQUFBLENBQUM7UUFDTixDQUFDLENBQUMsQ0FBQztJQUNQLENBQUMsQ0FBQyxDQUFBO0FBQ04sQ0FBQyxDQUFDLENBQUMiLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuLi90cy90eXBpbmdzL21haW4uZC50c1wiIFxubGV0IG5wbWcgPSByZXF1aXJlKFwiLi4vZGlzdC9pbmRleC5qc1wiKTtcbmxldCBzbWFydGVudiA9IHJlcXVpcmUoXCJzbWFydGVudlwiKTtcbmxldCBlbnZpcm9ubWVudCA9IHNtYXJ0ZW52LmdldEVudigpO1xuXG5cbiAgICBkZXNjcmliZShcIm5wbWdcIixmdW5jdGlvbigpe1xuICAgICAgICBkZXNjcmliZShcIi5pbnN0YWxsKClcIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgaXQoXCJzaG91bGQgaW5zdGFsbCBkZWZhdWx0IGxpc3QgZ2xvYmFsbHkgd2hlbiBwYXJzZWQgJ2RlZmF1bHQnIGFzIGFyZ3VtZW50XCIsZnVuY3Rpb24oKXtcbiAgICAgICAgICAgICAgICBpZiAoZW52aXJvbm1lbnQuaXNDOSB8fCBlbnZpcm9ubWVudC5pc0NJKXtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy50aW1lb3V0KDYwMDAwKTtcbiAgICAgICAgICAgICAgICAgICAgbnBtZy5pbnN0YWxsKFwiZGVmYXVsdFwiKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pXG4gICAgfSk7XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
||||
|
16
test/test.ts
16
test/test.ts
@ -1,2 +1,16 @@
|
||||
let nodeg = require("../dist/index.js");
|
||||
/// <reference path="../ts/typings/main.d.ts"
|
||||
let npmg = require("../dist/index.js");
|
||||
let smartenv = require("smartenv");
|
||||
let environment = smartenv.getEnv();
|
||||
|
||||
|
||||
describe("npmg",function(){
|
||||
describe(".install()",function(){
|
||||
it("should install default list globally when parsed 'default' as argument",function(){
|
||||
if (environment.isC9 || environment.isCI){
|
||||
this.timeout(60000);
|
||||
npmg.install("default");
|
||||
};
|
||||
});
|
||||
})
|
||||
});
|
||||
|
@ -3,7 +3,9 @@ import plugins = require("./npmg.plugins");
|
||||
import paths = require("./npmg.paths");
|
||||
let installExec = function(packageNames:string[]){
|
||||
for (let packageName in packageNames){
|
||||
plugins.shelljs.exec("npm install -g " + packageName);
|
||||
let execCommand = "npm install -g " + packageNames[packageName];
|
||||
plugins.beautylog.info("now installing " + packageNames[packageName]);
|
||||
plugins.shelljs.exec(execCommand);
|
||||
};
|
||||
};
|
||||
|
||||
@ -15,10 +17,11 @@ let install = function(packageSetArg:String){
|
||||
switch (packageSetArg){
|
||||
case "default":
|
||||
installExec(packageLibrary.default);
|
||||
break;
|
||||
default:
|
||||
plugins.beautylog.warn("no set has been specified");
|
||||
break;
|
||||
}
|
||||
installExec(packageLibrary.default);
|
||||
};
|
||||
|
||||
export = install;
|
Loading…
Reference in New Issue
Block a user