diff options
author | Alystrasz <contact@remyraes.com> | 2022-02-12 22:56:47 +0100 |
---|---|---|
committer | Alystrasz <contact@remyraes.com> | 2022-02-12 22:56:47 +0100 |
commit | bdc9712634a77689150c2577e785419a7c13365a (patch) | |
tree | e294f1a8e5c73347631cdcf32ce45dc0b883cbf1 | |
parent | ee1dcc2b7cd3ba615ee0ae0be76b6ca32f495863 (diff) | |
download | Viper-bdc9712634a77689150c2577e785419a7c13365a.tar.gz Viper-bdc9712634a77689150c2577e785419a7c13365a.zip |
[fix] rename files to file.excluded if an update is available only
-rw-r--r-- | src/utils.js | 16 |
1 files changed, 8 insertions, 8 deletions
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() { // <file>.excluded, then rename them back after the extraction. The // unzip module does not support excluding files directly. async function update() { - // Renames excluded files to <file>.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 <file>.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); |