aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-16 15:45:46 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-16 15:45:46 -0400
commitbc54a759fa65eca3a480e5cd10e27384f5410a42 (patch)
tree05e75464d3f2d96d849684cdf1278498159de918 /editors
parent87684b48739c65c7321238f7da8bc6adc9f67751 (diff)
Check to see that the user `ols.json` exists before copying it
Diffstat (limited to 'editors')
-rw-r--r--editors/vscode/package.json2
-rw-r--r--editors/vscode/src/extension.ts11
2 files changed, 8 insertions, 5 deletions
diff --git a/editors/vscode/package.json b/editors/vscode/package.json
index 51df9b2..fcf8d27 100644
--- a/editors/vscode/package.json
+++ b/editors/vscode/package.json
@@ -7,7 +7,7 @@
"type": "git",
"url": "git://github.com/DanielGavin/ols.git"
},
- "version": "0.1.40",
+ "version": "0.1.42",
"engines": {
"vscode": "^1.96.0"
},
diff --git a/editors/vscode/src/extension.ts b/editors/vscode/src/extension.ts
index 4b9ea44..4081bd6 100644
--- a/editors/vscode/src/extension.ts
+++ b/editors/vscode/src/extension.ts
@@ -416,18 +416,21 @@ async function checkForUpdates(config: Config, state: PersistentState, required:
const latestExecutable = getExecutable(config, release.id);
if (!await fs.stat(latestDestFolder).then(() => true, () => false)) {
- await fs.mkdir(latestDestFolder)
+ await fs.mkdir(latestDestFolder);
}
zip.extractAllTo(latestDestFolder, true);
- const ext = getExt()
+ const ext = getExt();
if (ext !== ".exe") {
fs.chmod(latestExecutable, 0o755);
}
- const prevFolder = getDestFolder(config, state.releaseId)
- await fs.copyFile(`${prevFolder}/ols.json`, `${latestDestFolder}/ols.json`)
+ const prevFolder = getDestFolder(config, state.releaseId);
+ const prevOlsConfig = `${prevFolder}/ols.json`;
+ if (await fs.stat(prevOlsConfig).then(() => true, () => false)) {
+ await fs.copyFile(prevOlsConfig, `${latestDestFolder}/ols.json`)
+ }
await state.updateServerVersion(config.package.version);
await state.updateReleaseId(release.id);