1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
10 | exports.ensureOutputPaths = void 0;
|
11 | const fs_1 = require("fs");
|
12 | const path_1 = require("path");
|
13 | function ensureOutputPaths(baseOutputPath, i18n) {
|
14 | const outputPaths = i18n.shouldInline
|
15 | ? [...i18n.inlineLocales].map((l) => [
|
16 | l,
|
17 | i18n.flatOutput ? baseOutputPath : path_1.join(baseOutputPath, l),
|
18 | ])
|
19 | : [['', baseOutputPath]];
|
20 | for (const [, outputPath] of outputPaths) {
|
21 | if (!fs_1.existsSync(outputPath)) {
|
22 | fs_1.mkdirSync(outputPath, { recursive: true });
|
23 | }
|
24 | }
|
25 | return new Map(outputPaths);
|
26 | }
|
27 | exports.ensureOutputPaths = ensureOutputPaths;
|