mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-08 11:56:36 +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) {
|
if (!stats) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
if (stats.isFile() && path.endsWith('.ino')) {
|
if (stats.isFile()) {
|
||||||
return path;
|
return path.endsWith('.ino') ? path : undefined;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const entries = await fs.readdir(path, { withFileTypes: true });
|
const entries = await fs.readdir(path, { withFileTypes: true });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user