mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-01 12:42:50 +08:00
Add README to generated project. (#33)
* Add README to generated project * add logo.svg * syntax cleanup
This commit is contained in:
@@ -40,13 +40,21 @@ module.exports = function(hostPath, appName, verbose) {
|
||||
return fs.writeFileSync(dest, fs.readFileSync(src));
|
||||
}
|
||||
fs.mkdirSync(path.join(hostPath, 'src'));
|
||||
fs.readdirSync(path.join(selfPath, 'src')).forEach(function(filename) {
|
||||
fs.readdirSync(path.join(selfPath, 'template/src')).forEach(function(filename) {
|
||||
copySync(
|
||||
path.join(selfPath, 'src', filename),
|
||||
path.join(selfPath, 'template/src', filename),
|
||||
path.join(hostPath, 'src', filename)
|
||||
);
|
||||
});
|
||||
copySync(path.join(selfPath, 'index.html'), path.join(hostPath, 'index.html'));
|
||||
fs.readdirSync(path.join(selfPath, 'template')).forEach(function(filename) {
|
||||
if (fs.lstatSync(path.join(selfPath, 'template', filename)).isDirectory()) {
|
||||
return
|
||||
}
|
||||
copySync(
|
||||
path.join(selfPath, 'template', filename),
|
||||
path.join(hostPath, filename)
|
||||
);
|
||||
});
|
||||
|
||||
// Run another npm install for react and react-dom
|
||||
console.log('Installing react and react-dom from npm...');
|
||||
|
||||
Reference in New Issue
Block a user