`no such file or directory, lstat` between `analyze()` calls if directory changes
kachkaev opened this issue Β· comments
π again @Nixinova π
Here is another small bug π As Iβve mentioned in #3, I work with two folders: my-analytics-tool
and my-analytics-tool-data
. The second folder contains the repo I want to analyse.
To create a time series with historic changes in the number of files, I do the following:
- Clone a repo into
my-analytics-tool-data
- List commits in
my-analytics-tool-data
- Checkout commit
x
- Run linguist
- Save a JSON summary for commit
x
- Pick another commit and continue from step 3.
So Iβve got a single script which calls analyze("/path/to/my-analytics-tool-data")
multiple times. The contents of the analysed folder changes between the calls. When this happens, the function throws with the following message:
Error: ENOENT: no such file or directory, lstat '/path/to/my-analytics-tool-data/path/to/deleted/file.ext'
at Object.lstatSync (fs.js:1115:3)
at Object.analyse (/path/to/my-analytics-tool/node_modules/linguist-js/dist/index.js:106:26)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5) {
errno: -2,
syscall: 'lstat',
code: 'ENOENT',
path: '/path/to/my-analytics-tool-data/path/to/deleted/file.ext'
}
Itβd be great to have an option to reset cache before running analyze or just make it default behaviour.
Regardless of this small glitch, thanks a lot for your effort! Iβve been waiting for this port for years π ππππ
I'll see if I can trap that error, thanks for reporting, and glad to be of help with this port.
Should be fixed in v2.0.2.
No more crashing in v2.0.2 π