fix(ci): stabilize windows paths
This commit is contained in:
@@ -36,7 +36,8 @@ function resolveUserPath(input: string): string {
|
||||
const trimmed = input.trim();
|
||||
if (!trimmed) return trimmed;
|
||||
if (trimmed.startsWith("~")) {
|
||||
return path.resolve(trimmed.replace("~", os.homedir()));
|
||||
const expanded = trimmed.replace(/^~(?=$|[\\/])/, os.homedir());
|
||||
return path.resolve(expanded);
|
||||
}
|
||||
return path.resolve(trimmed);
|
||||
}
|
||||
|
||||
@@ -202,12 +202,14 @@ export function resolveStorePath(store?: string, opts?: { agentId?: string }) {
|
||||
const agentId = normalizeAgentId(opts?.agentId ?? DEFAULT_AGENT_ID);
|
||||
if (!store) return resolveDefaultSessionStorePath(agentId);
|
||||
if (store.includes("{agentId}")) {
|
||||
return path.resolve(
|
||||
store.replaceAll("{agentId}", agentId).replace("~", os.homedir()),
|
||||
);
|
||||
const expanded = store.replaceAll("{agentId}", agentId);
|
||||
if (expanded.startsWith("~")) {
|
||||
return path.resolve(expanded.replace(/^~(?=$|[\\/])/, os.homedir()));
|
||||
}
|
||||
return path.resolve(expanded);
|
||||
}
|
||||
if (store.startsWith("~"))
|
||||
return path.resolve(store.replace("~", os.homedir()));
|
||||
return path.resolve(store.replace(/^~(?=$|[\\/])/, os.homedir()));
|
||||
return path.resolve(store);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user