Skip to content

Commit

Permalink
Fixed default GameVersionProvider resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
Kir-Antipov committed May 20, 2023
1 parent 963eeb4 commit 5cb5700
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/program.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { McPublishInput, McPublishOutput } from "@/action";
import { GameVersionFilter, getGameVersionProviderByName } from "@/games";
import { MINECRAFT } from "@/games/minecraft";
import { LoaderMetadataReader, createDefaultLoaderMetadataReader } from "@/loaders";
import { PlatformType, createPlatformUploader } from "@/platforms";
import { GitHubContext } from "@/platforms/github";
Expand Down Expand Up @@ -102,7 +103,7 @@ async function fillInDefaultValues<T extends McPublishInput[PlatformType]>(optio
const primaryFile = options.files[0];
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 gameVersions = await gameVersionProvider?.(wrappedGameVersions);
const unwrappedGameVersions = gameVersions ? GameVersionFilter.filter(gameVersions, options.gameVersionFilter).map(x => x.id) : wrappedGameVersions;
Expand Down

0 comments on commit 5cb5700

Please sign in to comment.