mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 08:03:13 +09:00
Merge pull request #127 from chrisgbk/master
Fix race condition in node client download
This commit is contained in:
1 file changed
+5
-3
@@ -245,10 +245,12 @@ if (!command || command == "help" || command == "--help") {
|
|||||||
console.log(url);
|
console.log(url);
|
||||||
let file = fs.createWriteStream("sharedMods/"+name);
|
let file = fs.createWriteStream("sharedMods/"+name);
|
||||||
https.get(url, function(response) {
|
https.get(url, function(response) {
|
||||||
|
response.on('end', function () {
|
||||||
|
console.log("Downloaded "+name);
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
response.pipe(file);
|
response.pipe(file);
|
||||||
console.log("Downloaded "+name);
|
}).end();
|
||||||
process.exit(0);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} else if (command == "start" && instance === undefined) {
|
} else if (command == "start" && instance === undefined) {
|
||||||
console.log("ERROR: No instanceName provided!");
|
console.log("ERROR: No instanceName provided!");
|
||||||
|
|||||||
Reference in new issue
Block a user