counsel
Version:
the end of boilerplate. automatically bake structure, opinions, and business rules into projects
20 lines • 632 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const ALLOWED_BASENAMES = ['readme.md', 'README.md'];
exports.check = async ({ fs, path, ctx }) => {
for (const basename of ALLOWED_BASENAMES) {
const filename = path.resolve(ctx.projectDirname, basename);
const isExists = await fs
.lstat(filename)
.then(() => true)
.catch(() => false);
if (isExists)
return;
}
throw new Error('readme.md file missing');
};
exports.rule = {
name: 'assert-readme-exists',
check: exports.check
};
//# sourceMappingURL=readme.js.map