From 87a6b3054e59d83399c44e2e349462cb330afb51 Mon Sep 17 00:00:00 2001 From: tko39 <40425389+tko39@users.noreply.github.com> Date: Tue, 14 Mar 2023 21:08:41 +0200 Subject: [PATCH] fix(misc): cli - case in drive letters - windows (#15643) --- packages/nx/src/command-line/run-one.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/nx/src/command-line/run-one.ts b/packages/nx/src/command-line/run-one.ts index 877e5a514c..3752324c0e 100644 --- a/packages/nx/src/command-line/run-one.ts +++ b/packages/nx/src/command-line/run-one.ts @@ -163,6 +163,14 @@ export function calculateDefaultProjectName( projectsConfigurations: ProjectsConfigurations, nxJsonConfiguration: NxJsonConfiguration ) { + if (cwd && /^[A-Z]:/.test(cwd)) { + cwd = cwd.charAt(0).toLowerCase() + cwd.slice(1); + } + + if (root && /^[A-Z]:/.test(root)) { + root = root.charAt(0).toLowerCase() + root.slice(1); + } + let relativeCwd = cwd.replace(/\\/g, '/').split(root.replace(/\\/g, '/'))[1]; relativeCwd = relativeCwd.startsWith('/')