1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Check for path existence and directory type

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2020-10-28 15:59:28 +03:00
parent e933d171a7
commit 089f4ae99e

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)