@atomist/automation-client
Version:
Atomist API for software low-level client
53 lines • 1.45 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const appRoot = require("app-root-path");
const os = require("os");
function info(automations) {
const i = {
name: automations.name,
version: automations.version,
};
if (automations.team_ids) {
i.team_ids = automations.team_ids;
}
if (automations.groups) {
i.groups = automations.groups;
}
try {
const pj = require(`${appRoot.path}/package.json`);
i.description = pj.description;
i.license = pj.license;
i.author = pj.author && pj.author.name ? pj.author.name : pj.author;
i.homepage = pj.homepage;
}
catch (err) {
// Ignore missing app package.json
}
try {
const pj = require("../../../package.json");
i.client = {
name: pj.name,
version: pj.version,
};
}
catch (err) {
// Ignore the missing package.json
}
try {
// see if we can load git-info.json from the root of the project
const gi = require(`${appRoot.path}/git-info.json`);
i.git = Object.assign({}, gi);
}
catch (err) {
// Ignore the missing git-info.json
}
i.system = {
hostname: os.hostname(),
type: os.type(),
release: os.release(),
platform: os.platform(),
};
return i;
}
exports.info = info;
//# sourceMappingURL=info.js.map