Skip to content

Commit

Permalink
fix: error when file is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
alvindimas05 committed Oct 20, 2024
1 parent 019f6d0 commit 109ac88
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/commandline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,18 @@ export default class CommandLine {
const files = fs.readdirSync(dir);

for (const file of files) {
const filePath = path.join(dir, file);
const stats = fs.statSync(filePath);

if (stats.isDirectory() && !filePath.endsWith('.app')) {
this.getApps(filePath);
} else if (filePath.endsWith('.app')) {
const app = new App(filePath);
if(!app.supported()) continue;
this.supportedApps.push(new App(filePath));
}
try {
const filePath = path.join(dir, file);
const stats = fs.statSync(filePath);

if (stats.isDirectory() && !filePath.endsWith('.app')) {
this.getApps(filePath);
} else if (filePath.endsWith('.app')) {
const app = new App(filePath);
if(!app.supported()) continue;
this.supportedApps.push(new App(filePath));
}
} catch {}
}
}
}

0 comments on commit 109ac88

Please sign in to comment.