diff --git a/.eslintrc b/.eslintrc index af441d5..4a5d3e2 100644 --- a/.eslintrc +++ b/.eslintrc @@ -11,7 +11,7 @@ ], "rules": { "arrow-body-style": ["error", "as-needed"], - "complexity": ["warn", { "max": 20 }], + "complexity": ["warn", { "max": 30 }], "curly": ["error", "multi-line", "consistent"], "eqeqeq": ["error", "smart"], "no-constant-condition": ["error", { "checkLoops": false }], diff --git a/src/publishing/mod-publisher.ts b/src/publishing/mod-publisher.ts index 1dac53c..d4085da 100644 --- a/src/publishing/mod-publisher.ts +++ b/src/publishing/mod-publisher.ts @@ -63,10 +63,10 @@ export default abstract class ModPublisher extends Pub throw new Error(`Specified files (${typeof fileSelector === "string" ? fileSelector : fileSelector.primary}) were not found`); } - const version = this.options.version || releaseInfo?.tag_name || parseVersionFromFilename(files[0].name); + const version = (typeof this.options.version === "string" && this.options.version) || releaseInfo?.tag_name || parseVersionFromFilename(files[0].name); const versionType = this.options.versionType?.toLowerCase() || parseVersionTypeFromFilename(files[0].name); - const name = this.options.name || releaseInfo?.name || version; - const changelog = (this.options.changelog ? await readChangelog(this.options.changelog) : releaseInfo?.body) || ""; + const name = (typeof this.options.name === "string" && this.options.name) || releaseInfo?.name || version; + const changelog = ((typeof this.options.changelog === "string" || this.options.changelog?.file) ? (await readChangelog(this.options.changelog)) : releaseInfo?.body) || ""; const loaders = processMultilineInput(this.options.loaders, /\s+/); if (!loaders.length) {