mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-27 18:22:41 -08:00
refactor(main): extract CLI runtime deps into factory
This commit is contained in:
10
src/main.ts
10
src/main.ts
@@ -770,7 +770,12 @@ function handleCliCommand(
|
||||
args: CliArgs,
|
||||
source: CliCommandSource = "initial",
|
||||
): void {
|
||||
const deps = createCliCommandDepsRuntimeService({
|
||||
const deps = createCliCommandDepsRuntimeService(createCliCommandRuntimeServiceDeps());
|
||||
handleCliCommandService(args, source, deps);
|
||||
}
|
||||
|
||||
function createCliCommandRuntimeServiceDeps() {
|
||||
return {
|
||||
mpv: {
|
||||
getSocketPath: () => appState.mpvSocketPath,
|
||||
setSocketPath: (socketPath) => {
|
||||
@@ -832,8 +837,7 @@ function handleCliCommand(
|
||||
error: (message, err) => {
|
||||
console.error(message, err);
|
||||
},
|
||||
});
|
||||
handleCliCommandService(args, source, deps);
|
||||
};
|
||||
}
|
||||
|
||||
function handleInitialArgs(): void {
|
||||
|
||||
Reference in New Issue
Block a user