Prevent duplicate leading file path by using resolve instead of prepending cwd.

This commit is contained in:
Dillon Kearns 2022-06-29 12:45:33 -07:00
parent 6850d98562
commit 4d0f9a8708

View File

@ -59,7 +59,7 @@ function lookupOrPerform(portsFile, mode, rawRequest, hasFsAccess) {
if (portsFile === undefined) {
throw "missing"
}
const portDataSourcePath = path.join(process.cwd(), portsFile);
const portDataSourcePath = path.resolve(portsFile);
// On Windows, we need cannot use paths directly and instead must use a file:// URL.
portDataSource = await import(url.pathToFileURL(portDataSourcePath).href);
} catch (e) {