mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-08 20:06:32 +00:00
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 <a.kitta@arduino.cc>
This commit is contained in:
parent
7d6a2d5e33
commit
c3dc7c6307
@ -181,8 +181,8 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
|
||||
if (!stats) {
|
||||
return undefined;
|
||||
}
|
||||
if (stats.isFile() && path.endsWith('.ino')) {
|
||||
return path;
|
||||
if (stats.isFile()) {
|
||||
return path.endsWith('.ino') ? path : undefined;
|
||||
}
|
||||
try {
|
||||
const entries = await fs.readdir(path, { withFileTypes: true });
|
||||
|
Loading…
x
Reference in New Issue
Block a user