From 30f9151b3013d9122abd42c1286842fe6981f555 Mon Sep 17 00:00:00 2001 From: Orkun Tokdemir Date: Thu, 15 Aug 2024 10:53:44 +0200 Subject: [PATCH] Kit: Normalize `qtFolder` path vscode allows using slashes in paths on Windows. In that situation, `qtFolder` should be normalized while generating kit names. Otherwise, kit names have additional `Qt-C` prefix. Change-Id: I6b4dc953dffac2bc0d1779c6bfdb12edf8efb556 Reviewed-by: Marcus Tillmanns --- qt-official/src/util/get-qt-paths.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt-official/src/util/get-qt-paths.ts b/qt-official/src/util/get-qt-paths.ts index 92b2597..ddc8593 100644 --- a/qt-official/src/util/get-qt-paths.ts +++ b/qt-official/src/util/get-qt-paths.ts @@ -34,8 +34,8 @@ export function mangleQtInstallation( qtFolder: string, installation: string ): string { - installation = installation.replace(qtFolder, ''); - const pathParts = installation.split(/[/\\:]+/).filter((n) => n); + installation = path.relative(qtFolder, installation); + const pathParts = installation.split(path.sep).filter(String); pathParts.unshift(path.basename(qtFolder)); return pathParts.slice().join('-'); }