Check for path existence and directory type

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2020-10-28 15:59:28 +03:00
1 parent e933d171a7
commit 089f4ae99e
1 file changed
+3
+3
View File
@@ -131,6 +131,9 @@ export class ExtensionManager {
continue
}
const absPath = path.resolve(folderPath, fileName);
if (!fs.existsSync(absPath) || !fs.lstatSync(absPath).isDirectory()) {
continue;
}
const manifestPath = path.resolve(absPath, "package.json");
await fs.access(manifestPath, fs.constants.F_OK)
const ext = await this.getExtensionByManifest(manifestPath).catch(() => null)