mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-27 18:22:41 -08:00
refactor: split main runtime flows into focused modules
This commit is contained in:
21
src/main/runtime/cli-command-prechecks.ts
Normal file
21
src/main/runtime/cli-command-prechecks.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { CliArgs } from '../../cli/args';
|
||||
|
||||
export function createHandleTexthookerOnlyModeTransitionHandler(deps: {
|
||||
isTexthookerOnlyMode: () => boolean;
|
||||
setTexthookerOnlyMode: (enabled: boolean) => void;
|
||||
commandNeedsOverlayRuntime: (args: CliArgs) => boolean;
|
||||
startBackgroundWarmups: () => void;
|
||||
logInfo: (message: string) => void;
|
||||
}) {
|
||||
return (args: CliArgs): void => {
|
||||
if (
|
||||
deps.isTexthookerOnlyMode() &&
|
||||
!args.texthooker &&
|
||||
(args.start || deps.commandNeedsOverlayRuntime(args))
|
||||
) {
|
||||
deps.setTexthookerOnlyMode(false);
|
||||
deps.logInfo('Disabling texthooker-only mode after overlay/start command.');
|
||||
deps.startBackgroundWarmups();
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user