From 2dd82e858ead79cab8987f23754dcda5104ab40e Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Thu, 16 Nov 2017 09:58:08 -0500 Subject: [PATCH] use `writeFileSync` Thanks @thisandagain! --- bin/get-localized-urls | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/get-localized-urls b/bin/get-localized-urls index a899b6814..901665143 100755 --- a/bin/get-localized-urls +++ b/bin/get-localized-urls @@ -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);