refactor(main): extract CLI runtime deps into factory

This commit is contained in:
2026-02-14 01:16:25 -08:00
parent fcfd98843c
commit c8b286ad66

View File

@@ -770,7 +770,12 @@ function handleCliCommand(
args: CliArgs, args: CliArgs,
source: CliCommandSource = "initial", source: CliCommandSource = "initial",
): void { ): void {
const deps = createCliCommandDepsRuntimeService({ const deps = createCliCommandDepsRuntimeService(createCliCommandRuntimeServiceDeps());
handleCliCommandService(args, source, deps);
}
function createCliCommandRuntimeServiceDeps() {
return {
mpv: { mpv: {
getSocketPath: () => appState.mpvSocketPath, getSocketPath: () => appState.mpvSocketPath,
setSocketPath: (socketPath) => { setSocketPath: (socketPath) => {
@@ -832,8 +837,7 @@ function handleCliCommand(
error: (message, err) => { error: (message, err) => {
console.error(message, err); console.error(message, err);
}, },
}); };
handleCliCommandService(args, source, deps);
} }
function handleInitialArgs(): void { function handleInitialArgs(): void {