fix: normalize Unix-style paths to Windows format (/d/... → D:/...)

This commit is contained in:
neken
2026-04-10 16:09:29 +05:00
parent 3e7f20668c
commit 5c777d69c5
2 changed files with 21 additions and 2 deletions
+6 -2
View File
@@ -1,5 +1,6 @@
import { Store, type SessionInfo } from "../state/store.js";
import { basename } from "path";
import { normalizePath } from "../utils/telegram.js";
export class SessionManager {
constructor(private store: Store) {}
@@ -19,12 +20,15 @@ export class SessionManager {
}
resolveProjectPath(nameOrPath: string): { name: string; path: string } | null {
// Check bookmarks first
const bookmarked = this.store.data.projects[nameOrPath];
if (bookmarked) {
return { name: nameOrPath, path: bookmarked };
}
const name = this.generateName(basename(nameOrPath));
return { name, path: nameOrPath };
// Treat as path — normalize for Windows
const normalizedPath = normalizePath(nameOrPath);
const name = this.generateName(basename(normalizedPath));
return { name, path: normalizedPath };
}
private generateName(base: string): string {