projectinfo/dist/projectinfo.classes.npm.js

25 lines
2.4 KiB
JavaScript
Raw Normal View History

2016-06-09 01:13:40 +00:00
"use strict";
2017-02-27 21:46:12 +00:00
Object.defineProperty(exports, "__esModule", { value: true });
2016-06-09 01:13:40 +00:00
require("typings-global");
2016-10-27 17:43:54 +00:00
const plugins = require("./projectinfo.plugins");
class ProjectinfoNpm {
constructor(cwdArg, optionsArg = {}) {
2016-11-26 13:45:56 +00:00
this.isNpm = false;
let resolvedCwd = plugins.path.resolve(cwdArg);
if (plugins.smartfile.fs.fileExists(plugins.path.join(resolvedCwd, 'package.json'))) {
this.isNpm = true;
this.packageJson = plugins.smartfile.fs.toObjectSync(plugins.path.join(resolvedCwd, '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 = new plugins.smartstring.GitRepo(this.packageJson.repository.url, optionsArg.gitAccessToken);
}
;
2016-06-09 01:13:40 +00:00
}
}
;
2016-10-27 17:43:54 +00:00
}
2016-06-09 01:13:40 +00:00
exports.ProjectinfoNpm = ProjectinfoNpm;
2017-02-27 21:46:12 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvamVjdGluZm8uY2xhc3Nlcy5ucG0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9wcm9qZWN0aW5mby5jbGFzc2VzLm5wbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUN2QixpREFBaUQ7QUFDakQ7SUFTSSxZQUFZLE1BQWMsRUFBRSxhQUEwQyxFQUFFO1FBUnhFLFVBQUssR0FBWSxLQUFLLENBQUE7UUFTbEIsSUFBSSxXQUFXLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUE7UUFDOUMsRUFBRSxDQUFDLENBQUMsT0FBTyx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