From 2b4fd7f456471d8f2b4e6a1778c2196857b01aa9 Mon Sep 17 00:00:00 2001 From: ThatBen Date: Wed, 2 Apr 2025 11:25:33 +0200 Subject: [PATCH] attempting to retain root slash in unix systems --- src/utils/pathSelector.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/pathSelector.js b/src/utils/pathSelector.js index 034ff6f..db26dcd 100644 --- a/src/utils/pathSelector.js +++ b/src/utils/pathSelector.js @@ -58,7 +58,11 @@ export class PathSelector { }; splitPath = (str) => { - return str.replaceAll("\\", "/").split("/"); + var result = str.replaceAll("\\", "/").split("/"); + if (str.startsWith("/") && this.roots.includes("/")) { + result = ["/", ...result]; + } + return result; }; dropEmptyParts = (parts) => {