Skip to content

Commit

Permalink
fix some omegga fields being undefined instead of a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
Meshiest committed Apr 23, 2023
1 parent 60abf68 commit f48f3ed
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "omegga",
"version": "1.0.36",
"version": "1.0.37",
"description": "Brickadia server installer, manager, wrapper, configurator, and automator",
"engines": {
"node": ">=18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type Terminal from '@cli/terminal';

export default class Logger {
static VERBOSE: boolean;
static VERBOSE = false;
static terminal: Terminal;

/**
Expand Down
19 changes: 10 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const program = commander
program.help();
process.exit(1);
}
Logger.VERBOSE = verbose;
Logger.VERBOSE = Boolean(verbose);

// default working directory is the one specified in config
let workDir = config.store.get('defaultOmegga');
Expand Down Expand Up @@ -193,7 +193,8 @@ program
global: globalAuth,
}) => {
const { verbose, debug } = program.opts();
Logger.VERBOSE = verbose;
Logger.VERBOSE = Boolean(verbose);

const workdirPath = path.join(
config.store.get('defaultOmegga'),
'data/Saved/Auth'
Expand Down Expand Up @@ -272,7 +273,7 @@ program
process.exit(1);
}
const { verbose, force } = program.opts();
Logger.VERBOSE = verbose;
Logger.VERBOSE = Boolean(verbose);
pluginUtil.install(plugins, { verbose, force });
});

Expand All @@ -292,7 +293,7 @@ program
process.exit(1);
}
const { verbose, force } = program.opts();
Logger.VERBOSE = verbose;
Logger.VERBOSE = Boolean(verbose);
pluginUtil.update(plugins, { verbose, force });
});

Expand All @@ -310,7 +311,7 @@ program
process.exit(1);
}
const { verbose } = program.opts();
Logger.VERBOSE = verbose;
Logger.VERBOSE = Boolean(verbose);
pluginUtil.check(plugins, { verbose });
});

Expand All @@ -320,7 +321,7 @@ program
.description('Initializes a new plugin with the given name and settings')
.action(async () => {
const { verbose } = program.opts();
Logger.VERBOSE = verbose;
Logger.VERBOSE = Boolean(verbose);

pluginUtil.init();
});
Expand All @@ -331,7 +332,7 @@ program
.option('-v, --verbose', 'Print extra messages for debugging purposes')
.action(async () => {
const { verbose } = program.opts();
Logger.VERBOSE = verbose;
Logger.VERBOSE = Boolean(verbose);

pluginUtil.init();
});
Expand All @@ -356,7 +357,7 @@ program
}
const { verbose } = program.opts();
const json = program.args.includes('-j') || program.args.includes('--json');
Logger.VERBOSE = verbose;
Logger.VERBOSE = Boolean(verbose);
if (!configName) {
pluginUtil.listConfig(pluginName, json);
} else {
Expand Down Expand Up @@ -386,7 +387,7 @@ program
}
const { verbose } = program.opts();
const yes = program.args.includes('-y') || program.args.includes('--yes');
Logger.VERBOSE = verbose;
Logger.VERBOSE = Boolean(verbose);
if (!configName) {
pluginUtil.resetAllConfigs(pluginName, yes);
} else if (!configValue) {
Expand Down
4 changes: 2 additions & 2 deletions src/omegga/plugin/plugin_node_safe/proxyOmegga.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Logger from '@/logger';
import {
OmeggaCore,
OmeggaLike,
Expand Down Expand Up @@ -33,13 +32,14 @@ export const bootstrap = (omegga: Omegga): Record<string, unknown[]> => ({
{
host: Object.freeze({ ...omegga.host }),
version: omegga.version,
verbose: Logger.VERBOSE,
verbose: omegga.verbose,
savePath: omegga.savePath,
path: omegga.path,
configPath: omegga.configPath,
presetPath: omegga.presetPath,
starting: omegga.starting,
started: omegga.started,
stopping: omegga.stopping,
config: omegga.config,
currentMap: omegga.currentMap,
},
Expand Down
6 changes: 3 additions & 3 deletions src/omegga/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ export default class Omegga extends OmeggaWrapper implements OmeggaLike {
host?: { id: string; name: string };
players: OmeggaPlayer[];

started: boolean;
starting: boolean;
stopping: boolean;
started = false;
starting = false;
stopping = false;
currentMap: string;

getServerStatus: () => Promise<IServerStatus>;
Expand Down

0 comments on commit f48f3ed

Please sign in to comment.