|
|
@@ -1,6 +1,6 @@
|
|
|
import { LanguageCode } from '@vendure/common/lib/generated-types';
|
|
|
import * as fs from 'fs-extra';
|
|
|
-import glob from 'glob';
|
|
|
+import { globSync } from 'glob';
|
|
|
import * as path from 'path';
|
|
|
|
|
|
import { Extension, TranslationExtension, Translations } from './types';
|
|
|
@@ -10,9 +10,9 @@ import { logger } from './utils';
|
|
|
* Given an array of extensions, returns a map of languageCode to all files specified by the
|
|
|
* configured globs.
|
|
|
*/
|
|
|
-export function getAllTranslationFiles(
|
|
|
- extensions: TranslationExtension[],
|
|
|
-): { [languageCode in LanguageCode]?: string[] } {
|
|
|
+export function getAllTranslationFiles(extensions: TranslationExtension[]): {
|
|
|
+ [languageCode in LanguageCode]?: string[];
|
|
|
+} {
|
|
|
// First collect all globs by language
|
|
|
const allTranslationsWithGlobs: { [languageCode in LanguageCode]?: string[] } = {};
|
|
|
for (const extension of extensions) {
|
|
|
@@ -38,7 +38,7 @@ export function getAllTranslationFiles(
|
|
|
continue;
|
|
|
}
|
|
|
for (const pattern of globs) {
|
|
|
- const files = glob.sync(pattern);
|
|
|
+ const files = globSync(pattern);
|
|
|
// tslint:disable-next-line:no-non-null-assertion
|
|
|
allTranslationsWithFiles[code]!.push(...files);
|
|
|
}
|