Ensure external extensions are in the extensions project (#178283)

This commit is contained in:
Tyler James Leonhardt 2023-03-26 07:55:04 -07:00 committed by GitHub
parent 792114a7ec
commit 0d5e948d86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

File diff suppressed because one or more lines are too long

View file

@ -843,9 +843,12 @@ export function prepareI18nPackFiles(resultingTranslationPaths: TranslationPath[
const extensionsPacks: Record<string, I18nPack> = {};
const errors: any[] = [];
return through(function (this: ThroughStream, xlf: File) {
const project = path.basename(path.dirname(path.dirname(xlf.relative)));
let project = path.basename(path.dirname(path.dirname(xlf.relative)));
// strip `-new` since vscode-extensions-loc uses the `-new` suffix to indicate that it's from the new loc pipeline
const resource = path.basename(path.basename(xlf.relative, '.xlf'), '-new');
if (EXTERNAL_EXTENSIONS.find(e => e === resource)) {
project = extensionsProject;
}
const contents = xlf.contents.toString();
log(`Found ${project}: ${resource}`);
const parsePromise = getL10nFilesFromXlf(contents);

View file

@ -24,7 +24,7 @@ function update(options) {
throw new Error(`${location} doesn't exist.`);
}
let externalExtensionsLocation = options.externalExtensionsLocation;
if (externalExtensionsLocation !== undefined && !fs.existsSync(location)) {
if (externalExtensionsLocation !== undefined && !fs.existsSync(externalExtensionsLocation)) {
throw new Error(`${externalExtensionsLocation} doesn't exist.`);
}
let locExtFolder = idOrPath;