mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-25 16:48:10 -05:00
use writeFileSync
Thanks @thisandagain!
This commit is contained in:
parent
b584bb80e7
commit
2dd82e858e
1 changed files with 1 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue