From bdc9712634a77689150c2577e785419a7c13365a Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sat, 12 Feb 2022 22:56:47 +0100 Subject: [fix] rename files to file.excluded if an update is available only --- src/utils.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/utils.js b/src/utils.js index 842ff99..5761558 100644 --- a/src/utils.js +++ b/src/utils.js @@ -212,14 +212,6 @@ function getTF2Version() { // .excluded, then rename them back after the extraction. The // unzip module does not support excluding files directly. async function update() { - // Renames excluded files to .excluded - for (let i = 0; i < settings.excludes.length; i++) { - let exclude = path.join(settings.gamepath + "/" + settings.excludes[i]); - if (fs.existsSync(exclude)) { - fs.renameSync(exclude, exclude + ".excluded") - } - } - ipcMain.emit("ns-update-event", "cli.update.checking"); console.log(lang("cli.update.checking")); var version = getNSVersion(); @@ -241,6 +233,14 @@ async function update() { ipcMain.emit("ns-update-event", "cli.update.downloading"); } + // Renames excluded files to .excluded + for (let i = 0; i < settings.excludes.length; i++) { + let exclude = path.join(settings.gamepath + "/" + settings.excludes[i]); + if (fs.existsSync(exclude)) { + fs.renameSync(exclude, exclude + ".excluded") + } + } + // Start the download of the zip https.get(requests.getLatestNsVersionLink(), (res) => { let stream = fs.createWriteStream(settings.zip); -- cgit v1.2.3