add repo information

This commit is contained in:
Philipp Kunz 2016-02-23 00:58:33 +01:00
parent d394588fff
commit e4ef9bf97a
2 changed files with 18 additions and 3 deletions

View File

@ -5,11 +5,18 @@ var ProjectinfoNPM = (function () {
this.packageJson = plugins.smartfile.readFileToObject(plugins.path.join(plugins.path.resolve(cwdArg), "package.json"));
this.name = this.packageJson.name;
this.version = this.packageJson.version;
this.license = this.packageJson.license;
this.status = "ok";
this.license = this.packageJson.license;
if (this.packageJson.repository) {
this.repoUrl = this.packageJson.repository.url;
}
else {
this.repoUrl = undefined;
}
;
}
return ProjectinfoNPM;
})();
module.exports = ProjectinfoNPM;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2plY3RpbmZvLm5wbS50cyJdLCJuYW1lcyI6WyJQcm9qZWN0aW5mb05QTSIsIlByb2plY3RpbmZvTlBNLmNvbnN0cnVjdG9yIl0sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcsdUJBQXVCLENBQUMsQ0FBQztBQUNsRDtJQU9JQSx3QkFBWUEsTUFBYUE7UUFDckJDLElBQUlBLENBQUNBLFdBQVdBLEdBQUdBLE9BQU9BLENBQUNBLFNBQVNBLENBQUNBLGdCQUFnQkEsQ0FDakRBLE9BQU9BLENBQUNBLElBQUlBLENBQUNBLElBQUlBLENBQ2JBLE9BQU9BLENBQUNBLElBQUlBLENBQUNBLE9BQU9BLENBQUNBLE1BQU1BLENBQUNBLEVBQzVCQSxjQUFjQSxDQUNqQkEsQ0FDSkEsQ0FBQ0E7UUFDRkEsSUFBSUEsQ0FBQ0EsSUFBSUEsR0FBR0EsSUFBSUEsQ0FBQ0EsV0FBV0EsQ0FBQ0EsSUFBSUEsQ0FBQ0E7UUFDbENBLElBQUlBLENBQUNBLE9BQU9BLEdBQUdBLElBQUlBLENBQUNBLFdBQVdBLENBQUNBLE9BQU9BLENBQUNBO1FBQ3hDQSxJQUFJQ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KTtcbiAgICAgICAgdGhpcy5uYW1lID0gdGhpcy5wYWNrYWdlSnNvbi5uYW1lO1xuICAgICAgICB0aGlzLnZlcnNpb24gPSB0aGlzLnBhY2thZ2VKc29uLnZlcnNpb247XG4gICAgICAgIHRoaXMuc3RhdHVzID0gXCJva1wiO1xuICAgICAgICB0aGlzLmxpY2Vuc2UgPSB0aGlzLnBhY2thZ2VKc29uLmxpY2Vuc2U7XG4gICAgICAgIGlmICh0aGlzLnBhY2thZ2VKc29uLnJlcG9zaXRvcnkpe1xuICAgICAgICAgICAgdGhpcy5yZXBvVXJsID0gdGhpcy5wYWNrYWdlSnNvbi5yZXBvc2l0b3J5LnVybDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMucmVwb1VybCA9IHVuZGVmaW5lZDtcbiAgICAgICAgfTtcblxuXG4gICAgfVxufVxuXG5leHBvcnQgPSBQcm9qZWN0aW5mb05QTTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=

View File

@ -6,6 +6,7 @@ class ProjectinfoNPM {
version:string;
status:string;
license:string;
repoUrl:string;
constructor(cwdArg:string){
this.packageJson = plugins.smartfile.readFileToObject(
@ -16,8 +17,15 @@ class ProjectinfoNPM {
);
this.name = this.packageJson.name;
this.version = this.packageJson.version;
this.license = this.packageJson.license;
this.status = "ok";
this.license = this.packageJson.license;
if (this.packageJson.repository){
this.repoUrl = this.packageJson.repository.url;
} else {
this.repoUrl = undefined;
};
}
}