update dependencies and structure
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import "typings-global"
|
||||
import plugins = require("./projectinfo.plugins");
|
||||
var projectinfo:any = {};
|
||||
|
||||
//npm
|
||||
import {ProjectinfoNpm} from "./projectinfo.classes.npm";
|
||||
@@ -10,8 +9,8 @@ export let npm = function(cwdArg,optionsArg){
|
||||
};
|
||||
|
||||
//quick functions
|
||||
projectinfo.getName = function(cwdArg){
|
||||
var localNpm = projectinfo.npm(cwdArg);
|
||||
export let getName = function(cwdArg){
|
||||
var localNpm = new ProjectinfoNpm(cwdArg);
|
||||
if (localNpm.status === "ok"){
|
||||
return localNpm.name;
|
||||
}
|
||||
|
@@ -9,18 +9,19 @@ export class ProjectinfoNpm {
|
||||
git;
|
||||
|
||||
constructor(cwdArg:string,optionsArg:{gitAccessToken?:string} = {}){
|
||||
this.packageJson = plugins.smartfile.readFileToObject(
|
||||
this.packageJson = plugins.smartfile.local.toObjectSync(
|
||||
plugins.path.join(
|
||||
plugins.path.resolve(cwdArg),
|
||||
"package.json"
|
||||
)
|
||||
),
|
||||
"json"
|
||||
);
|
||||
this.name = this.packageJson.name;
|
||||
this.version = this.packageJson.version;
|
||||
this.status = "ok";
|
||||
this.license = this.packageJson.license;
|
||||
if (this.packageJson.repository){
|
||||
this.git = plugins.smartstring.git(this.packageJson.repository.url,optionsArg.gitAccessToken);
|
||||
this.git = new plugins.smartstring.GitRepo(this.packageJson.repository.url,optionsArg.gitAccessToken);
|
||||
};
|
||||
|
||||
};
|
||||
|
@@ -1,9 +1,5 @@
|
||||
import "typings-global"
|
||||
var plugins = {
|
||||
path: require("path"),
|
||||
Q: require("q"),
|
||||
smartfile: require("smartfile"),
|
||||
smartstring: require("smartstring")
|
||||
};
|
||||
|
||||
export = plugins;
|
||||
export let path = require("path");
|
||||
export let Q = require("q");
|
||||
export import smartfile = require("smartfile");
|
||||
export import smartstring = require("smartstring");
|
Reference in New Issue
Block a user