1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', {
|
4 | value: true
|
5 | });
|
6 | exports.default = getProjectNamesMissingWarning;
|
7 | function _chalk() {
|
8 | const data = _interopRequireDefault(require('chalk'));
|
9 | _chalk = function () {
|
10 | return data;
|
11 | };
|
12 | return data;
|
13 | }
|
14 | var _getProjectDisplayName = _interopRequireDefault(
|
15 | require('./getProjectDisplayName')
|
16 | );
|
17 | function _interopRequireDefault(obj) {
|
18 | return obj && obj.__esModule ? obj : {default: obj};
|
19 | }
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | function getProjectNamesMissingWarning(projectConfigs, opts) {
|
28 | const numberOfProjectsWithoutAName = projectConfigs.filter(
|
29 | config => !(0, _getProjectDisplayName.default)(config)
|
30 | ).length;
|
31 | if (numberOfProjectsWithoutAName === 0) {
|
32 | return undefined;
|
33 | }
|
34 | const args = [];
|
35 | if (opts.selectProjects) {
|
36 | args.push('--selectProjects');
|
37 | }
|
38 | if (opts.ignoreProjects) {
|
39 | args.push('--ignoreProjects');
|
40 | }
|
41 | return _chalk().default.yellow(
|
42 | `You provided values for ${args.join(' and ')} but ${
|
43 | numberOfProjectsWithoutAName === 1
|
44 | ? 'a project does not have a name'
|
45 | : `${numberOfProjectsWithoutAName} projects do not have a name`
|
46 | }.\n` +
|
47 | 'Set displayName in the config of all projects in order to disable this warning.\n'
|
48 | );
|
49 | }
|