mirror of
https://git.bits.team/Bits/mod-manager.git
synced 2025-07-07 03:29:43 -04:00
Compare commits
4 Commits
c43554597f
...
master
Author | SHA1 | Date | |
---|---|---|---|
9afa90963a | |||
117fe9f9a9 | |||
c91ad26f60 | |||
518398d626 |
@ -81,7 +81,8 @@ cp -r build/flat/* "$INSTALL_DIR" || exit
|
||||
|
||||
# Creating executable
|
||||
info "Creating executable..."
|
||||
echo "node $INSTALL_DIR/index.js \$@" > $BINARY_PATH || exit
|
||||
echo "#!/bin/sh" > $BINARY_PATH || exit
|
||||
echo "node $INSTALL_DIR/index.js \$@" >> $BINARY_PATH || exit
|
||||
chmod +x $BINARY_PATH || exit
|
||||
|
||||
# Cleaning up
|
||||
|
@ -64,7 +64,7 @@ export default class ModManager {
|
||||
|
||||
Mods.registerSource(new ModrinthSource())
|
||||
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.showHelpAfterError();
|
||||
|
@ -13,13 +13,13 @@ import chalk from "chalk";
|
||||
export default class Mods {
|
||||
private static readonly MOD_SOURCES: Array<ModSource> = [];
|
||||
|
||||
public static registerSource(source: ModSource, envVar?: string) {
|
||||
if (envVar != undefined) {
|
||||
if (!process.env.hasOwnProperty(envVar)) {
|
||||
public static registerSource(source: ModSource, envVar?: string, suppressWarning?: boolean) {
|
||||
if (envVar && !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.`)
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.MOD_SOURCES.push(source);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user