1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | const _ = require("lodash");
|
9 | const projectDir = require("./core/projectDir");
|
10 | const logger = require("./core/logApi");
|
11 | module.exports = {
|
12 | validateProjectDir(command) {
|
13 | if (command.requiresProject) {
|
14 | projectDir.getPath();
|
15 | }
|
16 | },
|
17 | showDeprecationWarnings(command, context) {
|
18 | context.warnings = context.warnings || [];
|
19 | if (_.toUpper(process.env.SFDX_PRECOMPILE_DISABLE) === 'TRUE') {
|
20 | const msg = logger.formatDeprecationWarning('SFDX_PRECOMPILE_DISABLE', {
|
21 | version: 41,
|
22 | to: 'SFDX_PRECOMPILE_ENABLE=true to enable Apex pre-compilation.'
|
23 | }, 'environment variable');
|
24 | logger.warnUser(context, msg);
|
25 | }
|
26 | if (_.toUpper(process.env.SFDX_DISABLE_ENCRYPTION) === 'TRUE') {
|
27 | const msg = logger.formatDeprecationWarning('SFDX_DISABLE_ENCRYPTION', {
|
28 | version: 41,
|
29 | to: 'sfdx force:auth to re-authorize your orgs'
|
30 |
|
31 | }, 'environment variable');
|
32 | logger.warnUser(context, msg);
|
33 | }
|
34 | if (command.deprecated) {
|
35 | const msg = logger.formatDeprecationWarning(command.command ? `${command.topic}:${command.command}` : command.topic, command.deprecated, 'command');
|
36 | logger.warnUser(context, msg);
|
37 | }
|
38 | else if (context.flags) {
|
39 | _.each(command.flags, flag => {
|
40 | if (flag.deprecated && !_.isNil(context.flags[flag.name])) {
|
41 | const msg = logger.formatDeprecationWarning(flag.name, flag.deprecated, 'flag');
|
42 | logger.warnUser(context, msg);
|
43 | }
|
44 | });
|
45 | }
|
46 | }
|
47 | };
|
48 |
|
49 |
|