Adding some final details
This commit is contained in:
parent
3e5e0c56cf
commit
fce163a8b0
17
index.js
17
index.js
@ -163,8 +163,6 @@ async function checkFiles() {
|
||||
if (sum !== file.hash) {
|
||||
console.log("\x1b[33mFile " + file.name + " needs to be updated.\x1b[0m");
|
||||
filesToDownload.push(file);
|
||||
} else {
|
||||
// console.log("File " + file.name + " doesn't need to be downloaded again. ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +174,7 @@ async function downloadFiles(files) {
|
||||
var file = files[f];
|
||||
var filePath = path.join(basePath, ...(file.name.split("/")));
|
||||
|
||||
console.log("Downloading file " + file.name + "...");
|
||||
console.log("\x1b[35mDownloading file " + file.name + "...\x1b[0m");
|
||||
|
||||
await httpsDownload(file.baseUrl + file.hash, filePath);
|
||||
}
|
||||
@ -185,8 +183,7 @@ async function downloadFiles(files) {
|
||||
}
|
||||
|
||||
function launchLauncher() {
|
||||
// console.log("Launching the launcher ! ");
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
var launcherPath = path.join(basePath, "bin", "plutonium-launcher-win32.exe");
|
||||
|
||||
var subprocess = child_process.spawn(launcherPath, [], {
|
||||
@ -196,9 +193,18 @@ function launchLauncher() {
|
||||
|
||||
subprocess.on("spawn", function () {
|
||||
subprocess.unref();
|
||||
resolve();
|
||||
});
|
||||
|
||||
subprocess.on("error", function (error) {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
process.title = "Kroniker Updater - Plutonium Black Ops II";
|
||||
process.stdout.write("\x1b]0;Kroniker Updater - Plutonium Black Ops II\x07");
|
||||
|
||||
(async function () {
|
||||
var manifestCount = mustSkipCustom ? 1 : manifestURLs.length;
|
||||
|
||||
@ -224,7 +230,6 @@ function launchLauncher() {
|
||||
console.error("An error has occurred while downloading a file. \n" + error.stack);
|
||||
});
|
||||
} else {
|
||||
// console.log("All files seem good ! ");
|
||||
launchLauncher().then(function () {
|
||||
|
||||
}).catch(function (error) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "open-plutonium-updater",
|
||||
"description": "Updater for Kroniker Project's version of Plutonium Black Ops II",
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.2",
|
||||
"main": "index.js",
|
||||
"author": "X3F200C",
|
||||
"license": "GPL-3.0"
|
||||
|
Loading…
Reference in New Issue
Block a user