mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-26 00:55:16 -07:00
25 lines
701 B
TypeScript
25 lines
701 B
TypeScript
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;
|
|
}
|