mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 00:58:14 -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', () => {
|
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);
|
||||||
|
|
Loading…
Reference in a new issue