fixed path issue (#157)

Co-authored-by: afkarxyz <mzamzamafkarhadiq@gmail.com>
This commit is contained in:
enriqueqs
2025-12-12 11:31:13 +01:00
committed by GitHub
parent 64b86b65a1
commit ffd4daf031
4 changed files with 14 additions and 12 deletions
+3 -3
View File
@@ -19,10 +19,10 @@ export function sanitizePath(input: string, os: string): string {
export function joinPath(os: string, ...parts: string[]): string {
const sep = os === "Windows" ? "\\" : "/";
const filtered = parts.filter(Boolean);
if (filtered.length === 0) return "";
const joined = filtered
.map((p, i) => {
// For first part, only remove trailing slashes (preserve leading slash for absolute paths)
@@ -34,7 +34,7 @@ export function joinPath(os: string, ...parts: string[]): string {
})
.filter(Boolean) // Remove empty strings after trimming
.join(sep);
return joined;
}