Skip to content

Commit 915dbbb

Browse files
committed
Use process.cwd drive letter instead
1 parent 760a2fc commit 915dbbb

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

packages/playground/metro.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ const path = require('path');
1111

1212
// On Windows, require.resolve through symlinks (e.g. yarn workspace links) can
1313
// return paths with a different drive letter case than process.cwd(). Metro's
14-
// file system lookup is case-sensitive, so we must normalize to match.
14+
// file system lookup is case-sensitive, so we normalize to match cwd.
1515
function normalizePathDrive(p) {
1616
if (process.platform === 'win32' && p.length >= 2 && p[1] === ':') {
17-
return p[0].toUpperCase() + p.slice(1);
17+
return process.cwd()[0] + p.slice(1);
1818
}
1919
return p;
2020
}

vnext/template/metro.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ const path = require('path');
55

66
// On Windows, require.resolve through yarn workspace junctions can return paths
77
// with a different drive letter case than process.cwd(). Metro's internal file
8-
// system lookup is case-sensitive, so we normalize to match.
8+
// system lookup is case-sensitive, so we normalize to match cwd.
99
function normalizePathDrive(p) {
1010
if (process.platform === 'win32' && p.length >= 2 && p[1] === ':') {
11-
return p[0].toUpperCase() + p.slice(1);
11+
return process.cwd()[0] + p.slice(1);
1212
}
1313
return p;
1414
}

vnext/templates/cpp-app/metro.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ const path = require('node:path');
55

66
// On Windows, require.resolve through yarn workspace junctions can return paths
77
// with a different drive letter case than process.cwd(). Metro's internal file
8-
// system lookup is case-sensitive, so we normalize to match.
8+
// system lookup is case-sensitive, so we normalize to match cwd.
99
function normalizePathDrive(p) {
1010
if (process.platform === 'win32' && p.length >= 2 && p[1] === ':') {
11-
return p[0].toUpperCase() + p.slice(1);
11+
return process.cwd()[0] + p.slice(1);
1212
}
1313
return p;
1414
}

vnext/templates/cpp-lib/example/metro.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ const modules = Object.keys({ ...pack.peerDependencies });
99

1010
// On Windows, require.resolve through yarn workspace junctions can return paths
1111
// with a different drive letter case than process.cwd(). Metro's internal file
12-
// system lookup is case-sensitive, so we normalize to match.
12+
// system lookup is case-sensitive, so we normalize to match cwd.
1313
function normalizePathDrive(p) {
1414
if (process.platform === 'win32' && p.length >= 2 && p[1] === ':') {
15-
return p[0].toUpperCase() + p.slice(1);
15+
return process.cwd()[0] + p.slice(1);
1616
}
1717
return p;
1818
}

0 commit comments

Comments
 (0)