mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-22 00:11:02 -05:00
Fixed default GameVersionProvider
resolution
This commit is contained in:
parent
963eeb46a6
commit
5cb5700273
1 changed files with 2 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
import { McPublishInput, McPublishOutput } from "@/action";
|
import { McPublishInput, McPublishOutput } from "@/action";
|
||||||
import { GameVersionFilter, getGameVersionProviderByName } from "@/games";
|
import { GameVersionFilter, getGameVersionProviderByName } from "@/games";
|
||||||
|
import { MINECRAFT } from "@/games/minecraft";
|
||||||
import { LoaderMetadataReader, createDefaultLoaderMetadataReader } from "@/loaders";
|
import { LoaderMetadataReader, createDefaultLoaderMetadataReader } from "@/loaders";
|
||||||
import { PlatformType, createPlatformUploader } from "@/platforms";
|
import { PlatformType, createPlatformUploader } from "@/platforms";
|
||||||
import { GitHubContext } from "@/platforms/github";
|
import { GitHubContext } from "@/platforms/github";
|
||||||
|
@ -102,7 +103,7 @@ async function fillInDefaultValues<T extends McPublishInput[PlatformType]>(optio
|
||||||
const primaryFile = options.files[0];
|
const primaryFile = options.files[0];
|
||||||
const metadata = await reader?.readMetadataFile(primaryFile.path);
|
const metadata = await reader?.readMetadataFile(primaryFile.path);
|
||||||
|
|
||||||
const gameVersionProvider = getGameVersionProviderByName(metadata?.gameName);
|
const gameVersionProvider = getGameVersionProviderByName(metadata?.gameName || MINECRAFT);
|
||||||
const wrappedGameVersions = options.gameVersions?.length ? options.gameVersions : (metadata?.gameVersions || []);
|
const wrappedGameVersions = options.gameVersions?.length ? options.gameVersions : (metadata?.gameVersions || []);
|
||||||
const gameVersions = await gameVersionProvider?.(wrappedGameVersions);
|
const gameVersions = await gameVersionProvider?.(wrappedGameVersions);
|
||||||
const unwrappedGameVersions = gameVersions ? GameVersionFilter.filter(gameVersions, options.gameVersionFilter).map(x => x.id) : wrappedGameVersions;
|
const unwrappedGameVersions = gameVersions ? GameVersionFilter.filter(gameVersions, options.gameVersionFilter).map(x => x.id) : wrappedGameVersions;
|
||||||
|
|
Loading…
Reference in a new issue