Skip to content

Commit

Permalink
改名
Browse files Browse the repository at this point in the history
  • Loading branch information
walkerwzy committed Sep 20, 2017
1 parent d86846c commit 4eaa709
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ async function getFileContent(...components) {
return await fs.readFile(fullpath, 'utf8').catch(console.log);
}

async function genFileFromTemplate(filepath, tpl) {
async function renderFile(filepath, tpl) {
return await fs.writeFile(filepath, tpl, 'utf8').catch(console.log);
}

Expand Down Expand Up @@ -254,8 +254,8 @@ async function parseTemplate() {
// 输出路径
let h_file = getPath(out_model, model.className+'.h'),
m_file = getPath(out_model, model.className+'.m');
await genFileFromTemplate(h_file, eval(h_content)).catch(console.log);
await genFileFromTemplate(m_file, eval(m_content)).catch(console.log);
await renderFile(h_file, eval(h_content)).catch(console.log);
await renderFile(m_file, eval(m_content)).catch(console.log);
});
// ===================
// gen http request (task) file
Expand All @@ -278,8 +278,8 @@ async function parseTemplate() {
"args": methodArgs[i]
}
});
await genFileFromTemplate(h_file, eval(h_task)).catch(console.log);
await genFileFromTemplate(m_file, eval(m_task)).catch(console.log);
await renderFile(h_file, eval(h_task)).catch(console.log);
await renderFile(m_file, eval(m_task)).catch(console.log);

console.log(`all done. model path [${out_model}], task path [${out_task}]`)
}

0 comments on commit 4eaa709

Please sign in to comment.