Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
905 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 | /**
|
---|
3 | * @license
|
---|
4 | * Copyright Google LLC All Rights Reserved.
|
---|
5 | *
|
---|
6 | * Use of this source code is governed by an MIT-style license that can be
|
---|
7 | * found in the LICENSE file at https://angular.io/license
|
---|
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;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.