2016-03-02 00:34:48 +00:00
|
|
|
/// <reference path="./typings/main.d.ts" />
|
|
|
|
import plugins = require("./npmg.plugins");
|
2016-03-02 02:22:55 +00:00
|
|
|
import paths = require("./npmg.paths");
|
2016-03-02 00:34:48 +00:00
|
|
|
let installExec = function(packageNames:string[]){
|
|
|
|
for (let packageName in packageNames){
|
2016-03-03 01:04:14 +00:00
|
|
|
let execCommand = "npm install -g " + packageNames[packageName];
|
|
|
|
plugins.beautylog.info("now installing " + packageNames[packageName]);
|
|
|
|
plugins.shelljs.exec(execCommand);
|
2016-03-02 00:34:48 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-03-02 02:22:55 +00:00
|
|
|
let packageLibrary = plugins.smartfile.readFileToObject(
|
|
|
|
plugins.path.join(paths.packageBase,"packageLibrary.json")
|
|
|
|
);
|
2016-03-02 00:34:48 +00:00
|
|
|
|
2016-03-02 02:22:55 +00:00
|
|
|
let install = function(packageSetArg:String){
|
|
|
|
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
|
|
|
}
|
2016-03-02 00:34:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export = install;
|