Fix race condition in node client download

Fix race condition in node client download
This commit is contained in:
chrisgbk committed 2018-07-10 04:23:40 -06:00
1 parent 6962324a45
commit 9501861285
1 file changed
+5 -3
+5 -3
View File
@@ -245,10 +245,12 @@ if (!command || command == "help" || command == "--help") {
console.log(url);
let file = fs.createWriteStream("sharedMods/"+name);
https.get(url, function(response) {
response.on('end', function () {
console.log("Downloaded "+name);
process.exit(0);
});
response.pipe(file);
console.log("Downloaded "+name);
process.exit(0);
});
}).end();
}
} else if (command == "start" && instance === undefined) {
console.log("ERROR: No instanceName provided!");