Skip to content

Commit fd280ef

Browse files
Copilotdmichon-msft
andcommitted
Rename environment variable to RUSHSTACK_CLI_IGNORED_PARAMETER_NAMES
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
1 parent cbcf324 commit fd280ef

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

libraries/rush-lib/src/logic/operations/IgnoredParametersPlugin.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ const PLUGIN_NAME: string = 'IgnoredParametersPlugin';
1111
* Environment variable name for forwarding ignored parameters to child processes
1212
* @public
1313
*/
14-
export const RUSHSTACK_OPERATION_IGNORED_PARAMETERS_ENV_VAR: string =
15-
'RUSHSTACK_OPERATION_IGNORED_PARAMETERS';
14+
export const RUSHSTACK_CLI_IGNORED_PARAMETER_NAMES_ENV_VAR: string = 'RUSHSTACK_CLI_IGNORED_PARAMETER_NAMES';
1615

1716
/**
1817
* Phased command plugin that forwards the value of the `parameterNamesToIgnore` operation setting
19-
* to child processes as the RUSHSTACK_OPERATION_IGNORED_PARAMETERS environment variable.
18+
* to child processes as the RUSHSTACK_CLI_IGNORED_PARAMETER_NAMES environment variable.
2019
*/
2120
export class IgnoredParametersPlugin implements IPhasedCommandPlugin {
2221
public apply(hooks: PhasedCommandHooks): void {
@@ -27,7 +26,7 @@ export class IgnoredParametersPlugin implements IPhasedCommandPlugin {
2726

2827
// If there are parameter names to ignore, set the environment variable
2928
if (settings?.parameterNamesToIgnore && settings.parameterNamesToIgnore.length > 0) {
30-
env[RUSHSTACK_OPERATION_IGNORED_PARAMETERS_ENV_VAR] = settings.parameterNamesToIgnore.join(',');
29+
env[RUSHSTACK_CLI_IGNORED_PARAMETER_NAMES_ENV_VAR] = settings.parameterNamesToIgnore.join(',');
3130
}
3231

3332
return env;

libraries/rush-lib/src/logic/operations/test/IgnoredParametersPlugin.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { PhasedOperationPlugin } from '../PhasedOperationPlugin';
1313
import { ShellOperationRunnerPlugin } from '../ShellOperationRunnerPlugin';
1414
import {
1515
IgnoredParametersPlugin,
16-
RUSHSTACK_OPERATION_IGNORED_PARAMETERS_ENV_VAR
16+
RUSHSTACK_CLI_IGNORED_PARAMETER_NAMES_ENV_VAR
1717
} from '../IgnoredParametersPlugin';
1818
import {
1919
type ICreateOperationsContext,
@@ -99,7 +99,7 @@ describe(IgnoredParametersPlugin.name, () => {
9999
const envA: IEnvironment = hooks.createEnvironmentForOperation.call({ ...process.env }, mockRecordA);
100100

101101
// Verify the environment variable is set correctly for project 'a'
102-
expect(envA[RUSHSTACK_OPERATION_IGNORED_PARAMETERS_ENV_VAR]).toBe('--production');
102+
expect(envA[RUSHSTACK_CLI_IGNORED_PARAMETER_NAMES_ENV_VAR]).toBe('--production');
103103

104104
// Test project 'b' which has parameterNamesToIgnore: ["--verbose", "--config", "--mode", "--tags"]
105105
const operationB = Array.from(operations).find((op) => op.name === 'b');
@@ -110,7 +110,7 @@ describe(IgnoredParametersPlugin.name, () => {
110110
const envB: IEnvironment = hooks.createEnvironmentForOperation.call({ ...process.env }, mockRecordB);
111111

112112
// Verify the environment variable is set correctly for project 'b'
113-
expect(envB[RUSHSTACK_OPERATION_IGNORED_PARAMETERS_ENV_VAR]).toBe('--verbose,--config,--mode,--tags');
113+
expect(envB[RUSHSTACK_CLI_IGNORED_PARAMETER_NAMES_ENV_VAR]).toBe('--verbose,--config,--mode,--tags');
114114
});
115115

116116
it('should not set environment variable when parameterNamesToIgnore is not specified', async () => {
@@ -166,6 +166,6 @@ describe(IgnoredParametersPlugin.name, () => {
166166
const env: IEnvironment = hooks.createEnvironmentForOperation.call({ ...process.env }, mockRecord);
167167

168168
// Verify the environment variable is not set
169-
expect(env[RUSHSTACK_OPERATION_IGNORED_PARAMETERS_ENV_VAR]).toBeUndefined();
169+
expect(env[RUSHSTACK_CLI_IGNORED_PARAMETER_NAMES_ENV_VAR]).toBeUndefined();
170170
});
171171
});

0 commit comments

Comments
 (0)