Skip to content

Commit

Permalink
fix: compilation fails if basedir resolves to cwd (#65)
Browse files Browse the repository at this point in the history
Process.cwd missed the function call resulting in compilation error when baseDir resolved to process.cwd.
TS version: 4.3.5
  • Loading branch information
zszilvai committed Oct 25, 2021
1 parent 196b68c commit 9bac698
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/patch/lib/createProgram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function getProjectConfig(compilerOptions: TS.CompilerOptions, rootFileNames: Re
let projectDir = getProjectDir(compilerOptions);

if (configFilePath === undefined) {
const baseDir = (rootFileNames.length > 0) ? dirname(rootFileNames[0]) : projectDir ?? process.cwd;
const baseDir = (rootFileNames.length > 0) ? dirname(rootFileNames[0]) : projectDir ?? process.cwd();
configFilePath = ts.findConfigFile(baseDir, ts.sys.fileExists);

if (configFilePath) {
Expand Down

0 comments on commit 9bac698

Please sign in to comment.