未验证 提交 c7a2d199 编写于 作者: A Alex Dima

Move exist check to the right place

上级 ee09c5b2
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册