1 | const path = require('path');
|
2 | const fs = require('fs');
|
3 | const transform = require('../util/transform');
|
4 | const ncp = require('ncp').ncp;
|
5 |
|
6 |
|
7 | const Page = function(){
|
8 |
|
9 | }
|
10 |
|
11 | Page.config = (templatePath)=>{
|
12 | if(!templatePath){
|
13 | templatePath = './templates/page';
|
14 | }
|
15 | var text = fs.readFileSync(path.resolve(__dirname, `../config.js`) ,'utf-8')
|
16 | .replace(/"templatePath":".*"/, `"templatePath":"${templatePath}"`)
|
17 | fs.writeFileSync(path.resolve(__dirname, '../config.js'), text, { encoding:'utf-8', flag:'w' });
|
18 | }
|
19 |
|
20 | module.exports = Page;
|