tools/dist/npmg.install.js

27 lines
3.2 KiB
JavaScript
Raw Normal View History

2016-03-14 04:19:01 +00:00
"use strict";
2016-03-02 02:22:55 +00:00
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmg.plugins");
var paths = require("./npmg.paths");
var installExec = function (packageNames) {
for (var packageName in packageNames) {
2016-03-03 01:04:14 +00:00
var execCommand = "npm install -g " + packageNames[packageName];
plugins.beautylog.info("now installing " + packageNames[packageName]);
plugins.shelljs.exec(execCommand);
2016-03-02 02:22:55 +00:00
}
;
};
var packageLibrary = plugins.smartfile.readFileToObject(plugins.path.join(paths.packageBase, "packageLibrary.json"));
var install = function (packageSetArg) {
switch (packageSetArg) {
case "default":
installExec(packageLibrary.default);
2016-03-03 01:04:14 +00:00
break;
2016-03-02 02:22:55 +00:00
default:
plugins.beautylog.warn("no set has been specified");
2016-03-03 01:04:14 +00:00
break;
2016-03-02 02:22:55 +00:00
}
};
module.exports = install;
2016-03-14 04:19:01 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWcuaW5zdGFsbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsNENBQTRDO0FBQzVDLElBQU8sT0FBTyxXQUFXLGdCQUFnQixDQUFDLENBQUM7QUFDM0MsSUFBTyxLQUFLLFdBQVcsY0FBYyxDQUFDLENBQUM7QUFDdkMsSUFBSSxXQUFXLEdBQUcsVUFBUyxZQUFxQjtJQUM1QyxHQUFHLENBQUMsQ0FBQyxJQUFJLFdBQVcsSUFBSSxZQUFZLENBQUMsQ0FBQSxDQUFDO1FBQ2xDLElBQUksV0FBVyxHQUFHLGlCQUFpQixHQUFHLFlBQVksQ0FBQyxXQUFXLENBQUMsQ0FBQztRQUNoRSxPQUFPLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxpQkFBaUIsR0FBRyxZQUFZLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQztRQUN0RSxPQU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