mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-28 00:55:16 -07:00
Fix Windows mpv logging and add log export (#88)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { exportLogsArchiveForCurrentUser } from '../../src/main/runtime/log-export.js';
|
||||
import type { ExportLogsResult } from '../../src/main/runtime/log-export.js';
|
||||
import type { LauncherCommandContext } from './context.js';
|
||||
|
||||
interface LogsCommandDeps {
|
||||
exportLogsArchive(): ExportLogsResult;
|
||||
}
|
||||
|
||||
const defaultDeps: LogsCommandDeps = {
|
||||
exportLogsArchive: () => exportLogsArchiveForCurrentUser(),
|
||||
};
|
||||
|
||||
export function runLogsCommand(
|
||||
context: LauncherCommandContext,
|
||||
deps: LogsCommandDeps = defaultDeps,
|
||||
): boolean {
|
||||
if (!context.args.logsExport) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const result = deps.exportLogsArchive();
|
||||
context.processAdapter.writeStdout(`${result.zipPath}\n`);
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user