fix: use resolveUserPath utility for tilde expansion
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
import { loadSessionStore } from "../../config/sessions/store.js";
|
||||
import { getRemoteSkillEligibility } from "../../infra/skills-remote.js";
|
||||
import { buildTtsSystemPromptHint } from "../../tts/tts.js";
|
||||
import { resolveUserPath } from "../../utils.js";
|
||||
|
||||
// Export HTML templates are bundled with this module
|
||||
const EXPORT_HTML_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "export-html");
|
||||
@@ -290,7 +291,7 @@ export async function buildExportSessionReply(params: HandleCommandsParams): Pro
|
||||
const timestamp = new Date().toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
||||
const defaultFileName = `openclaw-session-${entry.sessionId.slice(0, 8)}-${timestamp}.html`;
|
||||
const outputPath = args.outputPath
|
||||
? path.resolve(args.outputPath.startsWith("~") ? args.outputPath.replace("~", process.env.HOME ?? "") : args.outputPath)
|
||||
? resolveUserPath(args.outputPath)
|
||||
: path.join(params.workspaceDir, defaultFileName);
|
||||
|
||||
// Ensure directory exists
|
||||
|
||||
Reference in New Issue
Block a user