Skip to content

Commit

Permalink
fix: remove file:\\ when trying to read files with yarn's crossFs (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammisuli authored Feb 7, 2022
1 parent 0a0faca commit 35fe970
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libs/server/src/lib/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ export async function readAndCacheJsonFile(
json: {},
};
}
const fullFilePath = path.join(basedir, filePath);
let fullFilePath = path.join(basedir, filePath);
if (fullFilePath.startsWith('file:\\')) {
fullFilePath = fullFilePath.replace('file:\\', '');
}
try {
const stats = await crossFs.statPromise(fullFilePath);
if (fileContents[fullFilePath] || stats.isFile()) {
Expand Down

0 comments on commit 35fe970

Please sign in to comment.