Commit 2dd82e85 authored by Matthew Taylor's avatar Matthew Taylor

use `writeFileSync`

Thanks @thisandagain!
parent b584bb80
......@@ -36,9 +36,7 @@ https.get('https://resources.scratch.mit.edu/localized-urls.json', (res) => {
res.on('end', () => {
try {
var urlJson = JSON.parse(urlData);
fs.writeFile(filename, JSON.stringify(urlJson, null, ' '), (err) => {
if (err) process.stdout.write(`Failed writing file: ${err.message}\n`);
});
fs.writeFileSync(filename, JSON.stringify(urlJson, null, ' '));
} catch (e) {
process.stdout.write(`Failed parsing url data: ${e.message}\n`);
process.exit(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment