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) => { ...@@ -36,9 +36,7 @@ https.get('https://resources.scratch.mit.edu/localized-urls.json', (res) => {
res.on('end', () => { res.on('end', () => {
try { try {
var urlJson = JSON.parse(urlData); var urlJson = JSON.parse(urlData);
fs.writeFile(filename, JSON.stringify(urlJson, null, ' '), (err) => { fs.writeFileSync(filename, JSON.stringify(urlJson, null, ' '));
if (err) process.stdout.write(`Failed writing file: ${err.message}\n`);
});
} catch (e) { } catch (e) {
process.stdout.write(`Failed parsing url data: ${e.message}\n`); process.stdout.write(`Failed parsing url data: ${e.message}\n`);
process.exit(1); 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