cli-common: fix drive letter for target dir being lowercased on Windows

This commit is contained in:
Patrik Oldsberg
2020-09-01 00:56:34 +02:00
parent 697fe5c094
commit 8da37131da
+4 -1
View File
@@ -106,7 +106,10 @@ export function findOwnRootDir(ownDir: string) {
*/
export function findPaths(searchDir: string): Paths {
const ownDir = findOwnDir(searchDir);
const targetDir = fs.realpathSync(process.cwd());
// Drive letter can end up being lowercased here on Windows, bring back to uppercase for consistency
const targetDir = fs
.realpathSync(process.cwd())
.replace(/^[a-z]:/, str => str.toUpperCase());
// Lazy load this as it will throw an error if we're not inside the Backstage repo.
let ownRoot = '';