mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Create data/ folder instead of crashing
This commit is contained in:
committed by
Dan Abramov
parent
a0bc99409d
commit
7684c14d0c
@@ -50,8 +50,13 @@ const COMMANDS = [
|
||||
|
||||
// Simple helper to write out some JSON for debugging
|
||||
function writeTo(file, data) {
|
||||
var folder = path.join(__dirname, 'data');
|
||||
if (!fs.existsSync(folder)) {
|
||||
fs.mkdirSync(folder);
|
||||
}
|
||||
|
||||
fs.writeFile(
|
||||
path.join(__dirname, 'data', file),
|
||||
path.join(folder, file),
|
||||
JSON.stringify(data, null, 2)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user