mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-17 00:37:49 +00:00
Rebase semver parsing on main (#677)
Co-authored-by: Marco Rodolfi <marco.rodolfi.1992@gmail.com>
This commit is contained in:
+11
-1
@@ -1,3 +1,5 @@
|
||||
import { compare } from 'compare-versions';
|
||||
|
||||
import { InstallType, Plugin, installPlugin, installPlugins } from './plugin';
|
||||
import { getSetting, setSetting } from './utils/settings';
|
||||
|
||||
@@ -137,7 +139,15 @@ export async function checkForPluginUpdates(plugins: Plugin[]): Promise<PluginUp
|
||||
const updateMap = new Map<string, StorePluginVersion>();
|
||||
for (let plugin of plugins) {
|
||||
const remotePlugin = serverData?.find((x) => x.name == plugin.name);
|
||||
if (remotePlugin && remotePlugin.versions?.length > 0 && plugin.version != remotePlugin?.versions?.[0]?.name) {
|
||||
//FIXME: Ugly hack since plugin.version might be null during evaluation,
|
||||
//so this will set the older version possible
|
||||
const curVer = plugin.version ? plugin.version : '0.0';
|
||||
if (
|
||||
remotePlugin &&
|
||||
remotePlugin.versions?.length > 0 &&
|
||||
plugin.version != remotePlugin?.versions?.[0]?.name &&
|
||||
compare(remotePlugin?.versions?.[0]?.name, curVer, '>')
|
||||
) {
|
||||
updateMap.set(plugin.name, remotePlugin.versions[0]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user