mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-28 06:22:45 -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,
|
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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user