mirror of
https://git.bits.team/Bits/mod-manager.git
synced 2025-01-07 20:18:21 -05:00
Suppress Forgejo warning
This commit is contained in:
parent
c43554597f
commit
c91ad26f60
@ -64,7 +64,7 @@ export default class ModManager {
|
|||||||
|
|
||||||
Mods.registerSource(new ModrinthSource())
|
Mods.registerSource(new ModrinthSource())
|
||||||
Mods.registerSource(new CurseforgeSource(), "CURSEFORGE_API_KEY")
|
Mods.registerSource(new CurseforgeSource(), "CURSEFORGE_API_KEY")
|
||||||
Mods.registerSource(new ForgejoSource(), "FORGEJO_API_KEY")
|
Mods.registerSource(new ForgejoSource(), "FORGEJO_API_KEY", true)
|
||||||
|
|
||||||
this.program.showSuggestionAfterError();
|
this.program.showSuggestionAfterError();
|
||||||
this.program.showHelpAfterError();
|
this.program.showHelpAfterError();
|
||||||
|
@ -13,12 +13,12 @@ import chalk from "chalk";
|
|||||||
export default class Mods {
|
export default class Mods {
|
||||||
private static readonly MOD_SOURCES: Array<ModSource> = [];
|
private static readonly MOD_SOURCES: Array<ModSource> = [];
|
||||||
|
|
||||||
public static registerSource(source: ModSource, envVar?: string) {
|
public static registerSource(source: ModSource, envVar?: string, suppressWarning?: boolean) {
|
||||||
if (envVar != undefined) {
|
if (envVar && !process.env.hasOwnProperty(envVar)) {
|
||||||
if (!process.env.hasOwnProperty(envVar)) {
|
if (!suppressWarning)
|
||||||
PrintUtils.warn(`${source.getSourceName()} could not be registered as a mod source, as the required environment variable ${envVar} was not detected. Functionality related to ${source.getSourceName()} will be skipped.`)
|
PrintUtils.warn(`${source.getSourceName()} could not be registered as a mod source, as the required environment variable ${envVar} was not detected. Functionality related to ${source.getSourceName()} will be skipped.`)
|
||||||
return;
|
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
this.MOD_SOURCES.push(source);
|
this.MOD_SOURCES.push(source);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user