diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2020-06-18 21:46:08 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2020-06-18 21:46:08 +0200 |
commit | 569e5b05c483a152827faaeb54136fa2da7ede8e (patch) | |
tree | 6fce300ea72eb0c1284b35cd84c933c37dcdfc69 /modules/unicode | |
parent | f16a6e1bc9948648082ef07ad703cc0b00ebfff5 (diff) |
Downloads in installation script
Diffstat (limited to 'modules/unicode')
-rw-r--r-- | modules/unicode/unicode.js | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/modules/unicode/unicode.js b/modules/unicode/unicode.js index a937796..4a7f75a 100644 --- a/modules/unicode/unicode.js +++ b/modules/unicode/unicode.js @@ -105,25 +105,7 @@ module.exports = function (app, io, moddir) { if (fs.existsSync(dataFilePath)) { importDatabase(fs.readFileSync(dataFilePath).toString()); } else { - console.log("Downloading UnicodeData.txt..."); - - https.get("https://www.unicode.org/Public/13.0.0/ucd/UnicodeData.txt", res => { - if (res.statusCode != 200) { - console.log(`Could not download UnicodeData.txt: status code ${res.statusCode}`); - return; - } - - res.setEncoding("utf8"); - let buffer = ""; - res.on("data", data => buffer += data); - res.on("end", () => { - fs.writeFileSync(dataFilePath, buffer); - console.log("Downloaded UnicodeData.txt"); - importDatabase(buffer); - }); - }).on("error", err => { - console.log("Error downloading UnicodeData.txt:", err); - }); + throw new Error("UnicodeData.txt doesn't exist! Be sure to run ./install_prepare.sh"); } app.get("/unicode", (req, res) => { |