Move exist check to the right place

This commit is contained in:
Alex Dima
2020-08-06 23:08:28 +02:00
parent ee09c5b254
commit c7a2d199e3

View File

@@ -84,6 +84,17 @@ async function getBuiltInExtensionInfos() {
allExtensions.push(ext);
locations[ext.extensionPath] = path.join(BUILTIN_MARKETPLACE_EXTENSIONS_ROOT, ext.extensionPath);
}
for (const ext of allExtensions) {
if (ext.packageJSON.browser) {
let mainFilePath = path.join(locations[ext.extensionPath], ext.packageJSON.browser);
if (path.extname(mainFilePath) !== '.js') {
mainFilePath += '.js';
}
if (!await exists(mainFilePath)) {
fancyLog(`${ansiColors.red('Error')}: Could not find ${mainFilePath}. Use ${ansiColors.cyan('yarn watch-web')} to build the built-in extensions.`);
}
}
}
return { extensions: allExtensions, locations };
}
@@ -124,16 +135,6 @@ async function getExtensionPackageJSON(extensionPath) {
return; // unsupported
}
if (packageJSON.browser) {
let mainFilePath = path.join(extensionPath, packageJSON.browser);
if (path.extname(mainFilePath) !== '.js') {
mainFilePath += '.js';
}
if (!await exists(mainFilePath)) {
fancyLog(`${ansiColors.yellow('Warning')}: Could not find ${mainFilePath}. Use ${ansiColors.cyan('yarn gulp watch-web')} to build the built-in extensions.`);
}
}
const packageNLSPath = path.join(extensionPath, 'package.nls.json');
const packageNLSExists = await exists(packageNLSPath);
if (packageNLSExists) {