addExistingSourceFiles error
Describe the bug Version: 14.4.1
When adding source files through project.addExistingSourceFiles(["*.ts", "bar/*.ts"]);, I get the following error -
C:\dev\git\scratch\test_ts-simple-ast\node_modules\ts-simple-ast\dist\Project.js:168
finally { if (e_2) throw e_2.error; }
^
Error: ENOTDIR: not a directory, scandir 'C:\dev\git\scratch\test_ts-simple-ast\bar\chec.ts'
at Object.fs.readdirSync (fs.js:904:18)
at DefaultFileSystemHost.readDirSync (C:\dev\git\scratch\test_ts-simple-ast\node_modules\ts-simple-ast\dist\fileSystem\DefaultFileSystemHost.js:35:28)
at FileSystemWrapper.readDirSync (C:\dev\git\scratch\test_ts-simple-ast\node_modules\ts-simple-ast\dist\fileSystem\FileSystemWrapper.js:740:32)
at C:\dev\git\scratch\test_ts-simple-ast\node_modules\ts-simple-ast\dist\utils\FileUtils.js:241:57
at step (C:\dev\git\scratch\test_ts-simple-ast\node_modules\tslib\tslib.js:133:27)
at Object.next (C:\dev\git\scratch\test_ts-simple-ast\node_modules\tslib\tslib.js:114:57)
at step (C:\dev\git\scratch\test_ts-simple-ast\node_modules\tslib\tslib.js:118:143)
at Object.next (C:\dev\git\scratch\test_ts-simple-ast\node_modules\tslib\tslib.js:114:57)
at Function.from (native)
at Function.FileUtils.getDescendantDirectories (C:\dev\git\scratch\test_ts-simple-ast\node_modules\ts-simple-ast\dist\utils\FileUtils.js:235:22)
It works fine when I do project.addExistingSourceFiles(["foo/*.ts", "bar/*.ts"]);, or just project.addExistingSourceFiles(["*.ts"]);
To Reproduce
Set up a dir structure as
foobar.ts
foo/
bar.ts
bar/
foo.ts
And then run project.addExistingSourceFiles(["*.ts", "bar/*.ts"]);,
Expected behavior
Should be able to add the specified files in the specified glob pattern.
Thanks for reporting @sajal50! I had internally named a method incorrectly then used it according to its incorrect name (classic). Fixed and released in 14.4.2.
Thank you, @dsherret, for the quick resolution!