Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Nov 9, 2021
1 parent 05d4b11 commit 1490c51
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/javascripts/main/packageManager.ts
Expand Up @@ -297,20 +297,24 @@ async function checkForUpdate(
mapping: MappingFileHandler,
component: Component
) {
const installedVersion = await mapping.getInstalledVersionForComponent(component);
const installedVersion = await mapping.getInstalledVersionForComponent(
component
);
const latestVersion = component.content!.package_info.version;
log(
`Checking for update for ${component.content?.name}\n` +
`Latest: ${latestVersion} | Installed: ${installedVersion}`
);
if (compareVersions(latestVersion, installedVersion) === 1) {
/** Latest version is greater than installed version */
log('Downloading new version', component.content!.package_info.download_url);
log(
'Downloading new version',
component.content!.package_info.download_url
);
await installComponent(webContents, mapping, component, latestVersion);
}
}


async function installComponent(
webContents: Electron.WebContents,
mapping: MappingFileHandler,
Expand Down Expand Up @@ -421,4 +425,4 @@ async function uninstallComponent(mapping: MappingFileHandler, uuid: string) {
}
await deleteDir(path.join(Paths.userDataDir, componentMapping.location));
mapping.remove(uuid);
}
}

0 comments on commit 1490c51

Please sign in to comment.