Skip to content

Commit c3dc7c6

Browse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
fix: avoid ENOTDIR when opening second instance.
If the resource is a file, do not try to `readdir`, but return undefined Closes #1590 Signed-off-by: Akos Kitta <[email protected]>
1 parent 7d6a2d5 commit c3dc7c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: arduino-ide-extension/src/electron-main/theia/electron-main-application.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
181181
if (!stats) {
182182
return undefined;
183183
}
184-
if (stats.isFile() && path.endsWith('.ino')) {
185-
return path;
184+
if (stats.isFile()) {
185+
return path.endsWith('.ino') ? path : undefined;
186186
}
187187
try {
188188
const entries = await fs.readdir(path, { withFileTypes: true });

0 commit comments

Comments
 (0)