Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addExistingSourceFiles error #413

Closed
sajal50 opened this issue Aug 27, 2018 · 2 comments
Closed

addExistingSourceFiles error #413

sajal50 opened this issue Aug 27, 2018 · 2 comments
Labels

Comments

@sajal50
Copy link

sajal50 commented Aug 27, 2018

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.

@dsherret
Copy link
Owner

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.

@sajal50
Copy link
Author

sajal50 commented Aug 28, 2018

Thank you, @dsherret, for the quick resolution!

dsherret added a commit that referenced this issue May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants