This repository was archived by the owner on Jul 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +8
-2
lines changed Expand file tree Collapse file tree 4 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ type ModDbItem = {
2828type Release = {
2929 downloadUrl : string ;
3030 downloadCount : number ;
31+ version : string ;
3132} ;
3233
3334type Manifest = {
Original file line number Diff line number Diff line change 11import fs from 'fs-extra' ;
22import globby from 'globby' ;
33import path from 'path' ;
4+ import { coerce } from 'semver' ;
45
56import { modsText } from '../static-text' ;
67import { isEnabled } from './mod-manager' ;
@@ -48,7 +49,7 @@ export function getLocalModsSync(owmlPath: string) {
4849 name : manifest . name ,
4950 author : manifest . author ,
5051 uniqueName : manifest . uniqueName ,
51- localVersion : manifest . version ,
52+ localVersion : coerce ( manifest . version ) ?. version ?? manifest . version ,
5253 modPath : path . dirname ( manifestPath ) ,
5354 errors : [ ] ,
5455 dependencies : manifest . dependencies ?? [ ] ,
Original file line number Diff line number Diff line change 11import fetch from 'node-fetch' ;
2+ import { coerce } from 'semver' ;
23
34import { modsText } from '../static-text' ;
45import { manifestPartialToFull } from './manifest' ;
@@ -11,6 +12,7 @@ type RemoteMod = {
1112 manifest : Partial < Manifest > ;
1213 repo : string ;
1314 required ?: boolean ;
15+ version : string ;
1416} ;
1517
1618type RemoteModDatabase = {
@@ -41,6 +43,7 @@ export async function getModDatabase(
4143 downloadUrl,
4244 required,
4345 repo,
46+ version,
4447 } : RemoteMod ) => {
4548 const { manifest, missingAttributes } = manifestPartialToFull (
4649 partialManifest
@@ -50,7 +53,7 @@ export async function getModDatabase(
5053 name : manifest . name ,
5154 author : manifest . author ,
5255 uniqueName : manifest . uniqueName ,
53- remoteVersion : manifest . version ,
56+ remoteVersion : coerce ( version ) ?. version ?? version ,
5457 // TODO doesnt make sense for this to be here in remote mods
5558 modPath : `${ owmlPath } /Mods/${ manifest . uniqueName } ` ,
5659 errors : [ ] ,
Original file line number Diff line number Diff line change 177177 "react-dom" : " ^0.0.0-experimental-f77c7b9d7" ,
178178 "recoil" : " ^0.0.10" ,
179179 "regenerator-runtime" : " ^0.13.7" ,
180+ "semver" : " ^7.3.2" ,
180181 "unzipper" : " ^0.10.11"
181182 },
182183 "devEngines" : {
You can’t perform that action at this time.
0 commit comments