Skip to content

Commit 2d5024d

Browse files
committed
Address PR feedback
1 parent 2031c44 commit 2d5024d

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

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

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { FileSystem } from '@rushstack/node-core-library';
88
import type { IPhasedCommandPlugin, PhasedCommandHooks } from '../../pluginFramework/PhasedCommandHooks';
99
import type { IEnvironment } from '../../utilities/Utilities';
1010
import type { Operation } from './Operation';
11-
import type { IOperationRunnerContext } from './IOperationRunner';
1211
import type { IOperationExecutionResult } from './IOperationExecutionResult';
1312

1413
const PLUGIN_NAME: 'NodeDiagnosticDirPlugin' = 'NodeDiagnosticDirPlugin';
@@ -44,32 +43,25 @@ export class NodeDiagnosticDirPlugin implements IPhasedCommandPlugin {
4443
return diagnosticDir;
4544
};
4645

47-
hooks.beforeExecuteOperation.tap(
46+
hooks.createEnvironmentForOperation.tap(
4847
PLUGIN_NAME,
49-
(operation: IOperationRunnerContext & IOperationExecutionResult): undefined => {
50-
const diagnosticDir: string | undefined = getDiagnosticDir(operation.operation);
48+
(env: IEnvironment, record: IOperationExecutionResult) => {
49+
const diagnosticDir: string | undefined = getDiagnosticDir(record.operation);
5150
if (!diagnosticDir) {
52-
return;
51+
return env;
5352
}
5453

5554
// Not all versions of NodeJS create the directory, so ensure it exists:
5655
FileSystem.ensureFolder(diagnosticDir);
57-
}
58-
);
59-
60-
hooks.createEnvironmentForOperation.tap(PLUGIN_NAME, (env: IEnvironment, operation: Operation) => {
61-
const diagnosticDir: string | undefined = getDiagnosticDir(operation);
62-
if (!diagnosticDir) {
63-
return env;
64-
}
6556

66-
const { NODE_OPTIONS } = env;
57+
const { NODE_OPTIONS } = env;
6758

68-
const diagnosticDirEnv: string = `--diagnostic-dir="${diagnosticDir}"`;
59+
const diagnosticDirEnv: string = `--diagnostic-dir="${diagnosticDir}"`;
6960

70-
env.NODE_OPTIONS = NODE_OPTIONS ? `${NODE_OPTIONS} ${diagnosticDirEnv}` : diagnosticDirEnv;
61+
env.NODE_OPTIONS = NODE_OPTIONS ? `${NODE_OPTIONS} ${diagnosticDirEnv}` : diagnosticDirEnv;
7162

72-
return env;
73-
});
63+
return env;
64+
}
65+
);
7466
}
7567
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class ShellOperationRunner implements IOperationRunner {
6969
let hasWarningOrError: boolean = false;
7070

7171
// Run the operation
72-
terminal.writeLine('Invoking: ' + this._commandToRun);
72+
terminal.writeLine(`Invoking: ${this._commandToRun}`);
7373

7474
const { rushConfiguration, projectFolder } = this._rushProject;
7575

0 commit comments

Comments
 (0)