semantic-release-config
Version:
Bundles together an ambitious semantic-release shared configuration used across many project types
33 lines • 1.22 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.acquirePackage = exports.acquireVariables = exports.acquireProjectType = void 0;
const tslib_1 = require("tslib");
const fs = tslib_1.__importStar(require("node:fs"));
const YAML = tslib_1.__importStar(require("yaml"));
const acquireProjectType = () => {
if (fs.existsSync('./Taskfile.yml')) {
return YAML.parse(fs.readFileSync('./Taskfile.yml', 'utf8'));
}
return {
vars: {
REPOSITORY_SUBTYPE: 'generic',
REPOSITORY_TYPE: 'generic'
}
};
};
exports.acquireProjectType = acquireProjectType;
const acquireVariables = () => {
if (fs.existsSync('./.variables.json')) {
return JSON.parse(fs.readFileSync('./.variables.json').toString());
}
return new Error('package.json must be present in the project!');
};
exports.acquireVariables = acquireVariables;
const acquirePackage = () => {
if (fs.existsSync('./package.json')) {
return JSON.parse(fs.readFileSync('package.json').toString());
}
return new Error('package.json must be present in the project!');
};
exports.acquirePackage = acquirePackage;
//# sourceMappingURL=project.js.map
;