Add README to generated project. (#33)

* Add README to generated project

* add logo.svg

* syntax cleanup
This commit is contained in:
eanplatter
2016-07-20 23:05:41 -05:00
committed by Dan Abramov
parent 9df1c2ff16
commit a6edb523a8
9 changed files with 76 additions and 40 deletions

View File

@@ -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...');