add structure
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import plugins = require("./npmg.plugins");
|
||||
import install = require("./npmg.install");
|
||||
let npmg = {
|
||||
|
||||
};
|
||||
install: install
|
||||
};
|
||||
export = npmg;
|
@ -1,15 +1,24 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
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 defaultPackages = plugins.smartfile.readFileToObject("../default_packages.json");
|
||||
let packageLibrary = plugins.smartfile.readFileToObject(
|
||||
plugins.path.join(paths.packageBase,"packageLibrary.json")
|
||||
);
|
||||
|
||||
let install = function(){
|
||||
installExec(defaultPackages);
|
||||
let install = function(packageSetArg:String){
|
||||
switch (packageSetArg){
|
||||
case "default":
|
||||
installExec(packageLibrary.default);
|
||||
default:
|
||||
plugins.beautylog.warn("no set has been specified");
|
||||
}
|
||||
installExec(packageLibrary.default);
|
||||
};
|
||||
|
||||
export = install;
|
@ -1,2 +1,6 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import paths = require("./npmg.paths");
|
||||
import plugins = require("./npmg.plugins");
|
||||
let paths = {
|
||||
packageBase: plugins.path.join("__dirname","../")
|
||||
}
|
||||
export = paths;
|
@ -1,3 +1,5 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
export let beautylog = require("beautylog");
|
||||
export let path = require("path");
|
||||
export import shelljs = require("shelljs");
|
||||
export let smartfile = require("smartfile");
|
||||
export let smartfile = require("smartfile");
|
||||
|
Reference in New Issue
Block a user