name can be omitted with an empty string

This commit is contained in:
Kir_Antipov 2021-10-01 16:35:51 +03:00
parent fcfbc7c0f9
commit 28b0fcda55
3 changed files with 3 additions and 3 deletions

View file

@ -16,7 +16,7 @@ export default class CurseForgePublisher extends ModPublisher {
const data = {
changelog,
changelogType: "markdown",
displayName: name,
displayName: (parentFileId || !name) ? file.name : name,
parentFileID: parentFileId,
releaseType: channel,
gameVersions: parentFileId ? undefined : versions

View file

@ -57,7 +57,7 @@ export default abstract class ModPublisher extends Publisher<ModPublisherOptions
const version = (typeof options.version === "string" && options.version) || <string>releaseInfo?.tag_name || parseVersionFromFilename(files[0].name);
const versionType = options.versionType?.toLowerCase() || parseVersionTypeFromFilename(files[0].name);
const name = (typeof options.name === "string" && options.name) || <string>releaseInfo?.name || version;
const name = typeof options.name === "string" ? options.name : (<string>releaseInfo?.name || version);
const changelog = ((typeof options.changelog === "string" || options.changelog?.file) ? (await readChangelog(options.changelog)) : <string>releaseInfo?.body) || "";
const loaders = processMultilineInput(options.loaders, /\s+/);

View file

@ -10,7 +10,7 @@ export default class ModrinthPublisher extends ModPublisher {
protected async publishMod(id: string, token: string, name: string, version: string, channel: string, loaders: string[], gameVersions: string[], _java: string[], changelog: string, files: File[]): Promise<void> {
const data = {
version_title: name,
version_title: name || version,
version_number: version,
version_body: changelog,
release_channel: channel,