1 | "use strict";
|
2 |
|
3 | var _lodash = _interopRequireDefault(require("lodash"));
|
4 |
|
5 | var _fs = _interopRequireDefault(require("fs"));
|
6 |
|
7 | var _angularDefaults = _interopRequireDefault(require("../defaults/angular-defaults"));
|
8 |
|
9 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10 |
|
11 | const exec = require('child-process-promise').exec;
|
12 |
|
13 | module.exports = name => {
|
14 |
|
15 | const defaultsConfigString = _lodash.default.template(JSON.stringify(_angularDefaults.default))({
|
16 | 'appName': name
|
17 | });
|
18 |
|
19 |
|
20 | return exec('cat angular.json').then(result => {
|
21 | const newConfig = _lodash.default.merge(JSON.parse(result.stdout), JSON.parse(defaultsConfigString));
|
22 |
|
23 |
|
24 | _fs.default.writeFileSync('angular.json', JSON.stringify(newConfig));
|
25 |
|
26 |
|
27 | exec(`json -I -f angular.json`);
|
28 | });
|
29 | }; |
\ | No newline at end of file |