tools/dist/npmg.install.js

26 lines
3.2 KiB
JavaScript

/// <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) {
var execCommand = "npm install -g " + packageNames[packageName];
plugins.beautylog.info("now installing " + packageNames[packageName]);
plugins.shelljs.exec(execCommand);
}
;
};
var packageLibrary = plugins.smartfile.readFileToObject(plugins.path.join(paths.packageBase, "packageLibrary.json"));
var install = function (packageSetArg) {
switch (packageSetArg) {
case "default":
installExec(packageLibrary.default);
break;
default:
plugins.beautylog.warn("no set has been specified");
break;
}
};
module.exports = install;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWcuaW5zdGFsbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcsZ0JBQWdCLENBQUMsQ0FBQztBQUMzQyxJQUFPLEtBQUssV0FBVyxjQUFjLENBQUMsQ0FBQztBQUN2QyxJQUFJLFdBQVcsR0FBRyxVQUFTLFlBQXFCO0lBQzVDLEdBQUcsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxXQUFXLElBQUksWUFBWSxDQUFDLENBQUEsQ0FBQztRQUNsQyxJQUFJLFdBQVcsR0FBRyxpQkFBaUIsR0FBRyxZQUFZLENBQUMsV0FBVyxDQUFDLENBQUM7UUFDaEUsT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsaUJBQWlCLEdBQUcsWUFBWSxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUM7UUFDdEUsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsV0FBVyxDQUFDLENBQUM7SUFDdEMsQ0FBQztJQUFBLENBQUM7QUFDTixDQUFDLENBQUM7QUFFRixJQUFJLGNBQWMsR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLGdCQUFnQixDQU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