fix(misc): cli - case in drive letters - windows (#15643)
This commit is contained in:
parent
8e838b5aac
commit
87a6b3054e
@ -163,6 +163,14 @@ export function calculateDefaultProjectName(
|
|||||||
projectsConfigurations: ProjectsConfigurations,
|
projectsConfigurations: ProjectsConfigurations,
|
||||||
nxJsonConfiguration: NxJsonConfiguration
|
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];
|
let relativeCwd = cwd.replace(/\\/g, '/').split(root.replace(/\\/g, '/'))[1];
|
||||||
|
|
||||||
relativeCwd = relativeCwd.startsWith('/')
|
relativeCwd = relativeCwd.startsWith('/')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user