v5.7-patch1

This commit is contained in:
afkarxyz
2025-11-23 04:58:45 +07:00
parent d1bd7da2de
commit 5831a45839
25 changed files with 405 additions and 199 deletions
+16 -4
View File
@@ -18,11 +18,23 @@ export function sanitizePath(input: string, os: string): string {
export function joinPath(os: string, ...parts: string[]): string {
const sep = os === "Windows" ? "\\" : "/";
return parts
.filter(Boolean)
.map(p => p.replace(/^[/\\]+|[/\\]+$/g, ""))
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)
if (i === 0) {
return p.replace(/[/\\]+$/g, "");
}
// For other parts, remove both leading and trailing slashes
return p.replace(/^[/\\]+|[/\\]+$/g, "");
})
.filter(Boolean) // Remove empty strings after trimming
.join(sep);
return joined;
}
export function buildOutputPath(settings: Settings, folder?: string) {