johnfn / ts2gd

💥 Compile TypeScript to GDScript for Godot
210 stars 14 forks source link

Fix crash when renaming or deleting a file #54

Closed adamuso closed 2 years ago

adamuso commented 2 years ago

Fixed a crash when file was renamed or deleted.

Crash dump:

node:fs:1536
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, stat '/home/adam/Documents/git/adamuso/test-project/scripts/src/Test.ts'
    at Object.statSync (node:fs:1536:3)
    at ignored (/home/adam/Documents/git/adamuso/ts2gd/js/project/project.js:260:71)
    at matchPatterns (/home/adam/Documents/git/adamuso/ts2gd/node_modules/anymatch/index.js:62:18)
    at FSWatcher._userIgnored (/home/adam/Documents/git/adamuso/ts2gd/node_modules/anymatch/index.js:96:14)
    at FSWatcher._isIgnored (/home/adam/Documents/git/adamuso/ts2gd/node_modules/chokidar/index.js:779:15)
    at FSWatcher._remove (/home/adam/Documents/git/adamuso/ts2gd/node_modules/chokidar/index.js:895:27)
    at listener (/home/adam/Documents/git/adamuso/ts2gd/node_modules/chokidar/lib/nodefs-handler.js:381:18) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '/home/adam/Documents/git/adamuso/test-project/scripts/src/Test.ts'
}

closes #48

johnfn commented 2 years ago

Awesome, thank you!