feat:update init script

This commit is contained in:
pengfei.zhou
2019-12-09 14:10:45 +08:00
parent 9ba32487c6
commit ce35ebc40e
2 changed files with 4 additions and 3 deletions

View File

@@ -117,8 +117,9 @@ function initiOS(path, name) {
return console.error(err);
}
copyFolder(`${targetiOSPath}`, `${path}`, () => {
const mainFiles = `Example/ViewController.m`
fs.writeFileSync(`${path}/${mainFiles}`, fs.readFileSync(`${targetiOSPath}/${mainFiles}`).toString().replace(/__\$__/g, name))
['Example/SceneDelegate.m', 'Example/AppDelegate.m'].forEach(e => {
fs.writeFileSync(`${path}/${e}`, fs.readFileSync(`${targetiOSPath}/${e}`).toString().replace(/__\$__/g, name))
})
console.log(`Create Doric iOS Project Success`)
})
})