@jorgeucanorg/init
Version:
Add scully to your angular app
25 lines (24 loc) • 764 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular-devkit/schematics");
function default_1(options) {
return (host, context) => {
const name = options.title ? options.title : 'blog-X';
if (!host.exists(`./blog/${name}.md`)) {
host.create(`./blog/${name}.md`, `---
title: ${name}
description: blog description
publish: false
---
# ${name}
`);
context.logger.info(`✅️Blog ${name} file created`);
}
else {
// return name exist
throw new schematics_1.SchematicsException(`${name} exist in your blog folder`);
}
};
}
exports.default = default_1;
//# sourceMappingURL=index.js.map