diff --git a/src/installation.ts b/src/installation.ts index 732b80a..7e36c65 100644 --- a/src/installation.ts +++ b/src/installation.ts @@ -52,16 +52,18 @@ export async function isServeDUpToDate(file: string) { return semverCompare(v1, targetVersion) } +async function copyServeD(codeDBinFolder: string) { + atom.notifications.addInfo("Installing serve-d...") + // copy the whole served folder + await copy(bundledServerMap[process.platform], codeDBinFolder, { overwrite: true }) + atom.notifications.addSuccess("Serve-d was installed") +} + export async function installServeD() { const codeDBinFolder = await getCodeDBinFolder() const serveDPath = join(codeDBinFolder, serveDExeFileName) - if (!(await isServeDInstalled(serveDPath))) { - atom.notifications.addInfo("Installing serve-d...") - - // copy the whole served folder - await copy(bundledServerMap[process.platform], codeDBinFolder) - - atom.notifications.addSuccess("Serve-d was installed") + if (!(await isServeDInstalled(serveDPath)) || !(await isServeDUpToDate(serveDPath))) { + await copyServeD(codeDBinFolder) } return serveDPath }