mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-09 05:36:33 +00:00
Fixed endless loop in the sketch service.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
f9a98d708e
commit
d92fc25769
@ -52,14 +52,16 @@ export class SketchesServiceImpl implements SketchesService {
|
|||||||
const uris: string[] = [];
|
const uris: string[] = [];
|
||||||
const fsPath = FileUri.fsPath(uri);
|
const fsPath = FileUri.fsPath(uri);
|
||||||
const stats = fs.lstatSync(fsPath);
|
const stats = fs.lstatSync(fsPath);
|
||||||
if (stats.isDirectory && await this.isSketchFolder(uri)) {
|
if (stats.isDirectory) {
|
||||||
const fileNames = fs.readdirSync(fsPath);
|
if (await this.isSketchFolder(uri)) {
|
||||||
for (const fileName of fileNames) {
|
const fileNames = fs.readdirSync(fsPath);
|
||||||
const filePath = path.join(fsPath, fileName);
|
for (const fileName of fileNames) {
|
||||||
if (ALLOWED_FILE_EXTENSIONS.indexOf(path.extname(filePath)) !== -1
|
const filePath = path.join(fsPath, fileName);
|
||||||
&& fs.existsSync(filePath)
|
if (ALLOWED_FILE_EXTENSIONS.indexOf(path.extname(filePath)) !== -1
|
||||||
&& fs.lstatSync(filePath).isFile()) {
|
&& fs.existsSync(filePath)
|
||||||
uris.push(FileUri.create(filePath).toString())
|
&& fs.lstatSync(filePath).isFile()) {
|
||||||
|
uris.push(FileUri.create(filePath).toString())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return uris;
|
return uris;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user