Skip to content

Commit c7a2d19

Browse files
committed
Move exist check to the right place
1 parent ee09c5b commit c7a2d19

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

resources/serverless/code-web.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@ async function getBuiltInExtensionInfos() {
8484
allExtensions.push(ext);
8585
locations[ext.extensionPath] = path.join(BUILTIN_MARKETPLACE_EXTENSIONS_ROOT, ext.extensionPath);
8686
}
87+
for (const ext of allExtensions) {
88+
if (ext.packageJSON.browser) {
89+
let mainFilePath = path.join(locations[ext.extensionPath], ext.packageJSON.browser);
90+
if (path.extname(mainFilePath) !== '.js') {
91+
mainFilePath += '.js';
92+
}
93+
if (!await exists(mainFilePath)) {
94+
fancyLog(`${ansiColors.red('Error')}: Could not find ${mainFilePath}. Use ${ansiColors.cyan('yarn watch-web')} to build the built-in extensions.`);
95+
}
96+
}
97+
}
8798
return { extensions: allExtensions, locations };
8899
}
89100

@@ -124,16 +135,6 @@ async function getExtensionPackageJSON(extensionPath) {
124135
return; // unsupported
125136
}
126137

127-
if (packageJSON.browser) {
128-
let mainFilePath = path.join(extensionPath, packageJSON.browser);
129-
if (path.extname(mainFilePath) !== '.js') {
130-
mainFilePath += '.js';
131-
}
132-
if (!await exists(mainFilePath)) {
133-
fancyLog(`${ansiColors.yellow('Warning')}: Could not find ${mainFilePath}. Use ${ansiColors.cyan('yarn gulp watch-web')} to build the built-in extensions.`);
134-
}
135-
}
136-
137138
const packageNLSPath = path.join(extensionPath, 'package.nls.json');
138139
const packageNLSExists = await exists(packageNLSPath);
139140
if (packageNLSExists) {

0 commit comments

Comments
 (0)