cevuel-cli
Version:
Create element-ui project with vue<br/> Help you build a new project faster with configuration and title
20 lines (17 loc) • 524 B
JavaScript
const fs = require('fs');
const chalk = require('chalk');
function handleHtml(from, to, options) {
const ContextHTML = fs.readFileSync(from, 'utf8');
const newContextHTML = ContextHTML.replace(/\/\/ title.*?\/\/ endtitle/isg, options.answers.title);
try {
fs.writeFileSync(to, newContextHTML, 'utf8');
console.log(chalk.yellow('Copy Successed'));
} catch (e) {
console.error(chalk.red(e));
throw e;
}
}
module.exports = {
handleHtml
}