Skip to content
This repository was archived by the owner on Jul 23, 2023. It is now read-only.

Commit d7b1fea

Browse files
committed
Use release version instead of manifest version
1 parent 29fe9c8 commit d7b1fea

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

app/globals.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type ModDbItem = {
2828
type Release = {
2929
downloadUrl: string;
3030
downloadCount: number;
31+
version: string;
3132
};
3233

3334
type Manifest = {

app/services/get-local-mods.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import fs from 'fs-extra';
22
import globby from 'globby';
33
import path from 'path';
4+
import { coerce } from 'semver';
45

56
import { modsText } from '../static-text';
67
import { 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 ?? [],

app/services/get-mod-database.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import fetch from 'node-fetch';
2+
import { coerce } from 'semver';
23

34
import { modsText } from '../static-text';
45
import { manifestPartialToFull } from './manifest';
@@ -11,6 +12,7 @@ type RemoteMod = {
1112
manifest: Partial<Manifest>;
1213
repo: string;
1314
required?: boolean;
15+
version: string;
1416
};
1517

1618
type 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: [],

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@
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": {

0 commit comments

Comments
 (0)