1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', {
|
4 | value: true
|
5 | });
|
6 | exports.default = getProjectNamesMissingWarning;
|
7 |
|
8 | function _chalk() {
|
9 | const data = _interopRequireDefault(require('chalk'));
|
10 |
|
11 | _chalk = function () {
|
12 | return data;
|
13 | };
|
14 |
|
15 | return data;
|
16 | }
|
17 |
|
18 | var _getProjectDisplayName = _interopRequireDefault(
|
19 | require('./getProjectDisplayName')
|
20 | );
|
21 |
|
22 | function _interopRequireDefault(obj) {
|
23 | return obj && obj.__esModule ? obj : {default: obj};
|
24 | }
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | function getProjectNamesMissingWarning(projectConfigs) {
|
33 | const numberOfProjectsWithoutAName = projectConfigs.filter(
|
34 | config => !(0, _getProjectDisplayName.default)(config)
|
35 | ).length;
|
36 |
|
37 | if (numberOfProjectsWithoutAName === 0) {
|
38 | return undefined;
|
39 | }
|
40 |
|
41 | return _chalk().default.yellow(
|
42 | `You provided values for --selectProjects 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 | }
|