25 lines
2.4 KiB
JavaScript
25 lines
2.4 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
require("typings-global");
|
|
const plugins = require("./projectinfo.plugins");
|
|
class ProjectinfoNpm {
|
|
constructor(cwdArg, optionsArg = {}) {
|
|
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);
|
|
}
|
|
;
|
|
}
|
|
}
|
|
;
|
|
}
|
|
exports.ProjectinfoNpm = ProjectinfoNpm;
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvamVjdGluZm8uY2xhc3Nlcy5ucG0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9wcm9qZWN0aW5mby5jbGFzc2VzLm5wbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUN2QixpREFBaUQ7QUFDakQ7SUFTSSxZQUFZLE1BQWMsRUFBRSxhQUEwQyxFQUFFO1FBUnhFLFVBQUssR0FBWSxLQUFLLENBQUE7UUFTbEIsSUFBSSxXQUFXLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUE7UUFDOUMsRUFBRSxDQUFDLENBQUMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxFQUFFLENBQUMsVUFBVSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSS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