From 0ace1a50a4fae8ebe3ec5fcd2a87ff2525712565 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Wed, 22 Mar 2023 12:58:21 -0700 Subject: [PATCH] Fix an issue where rush plugin autoinstallers would fail to install because the Rush global folder had not yet been initialized. --- .../rush/fix-plugin-installation_2023-03-22-19-55.json | 10 ++++++++++ libraries/rush-lib/src/cli/RushCommandLineParser.ts | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 common/changes/@microsoft/rush/fix-plugin-installation_2023-03-22-19-55.json diff --git a/common/changes/@microsoft/rush/fix-plugin-installation_2023-03-22-19-55.json b/common/changes/@microsoft/rush/fix-plugin-installation_2023-03-22-19-55.json new file mode 100644 index 00000000000..7313e039f13 --- /dev/null +++ b/common/changes/@microsoft/rush/fix-plugin-installation_2023-03-22-19-55.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Fix an issue where rush plugin autoinstallers would fail to install because the Rush global folder had not yet been initialized.", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/libraries/rush-lib/src/cli/RushCommandLineParser.ts b/libraries/rush-lib/src/cli/RushCommandLineParser.ts index 1836e897028..03055fdd931 100644 --- a/libraries/rush-lib/src/cli/RushCommandLineParser.ts +++ b/libraries/rush-lib/src/cli/RushCommandLineParser.ts @@ -66,7 +66,7 @@ export interface IRushCommandLineParserOptions { export class RushCommandLineParser extends CommandLineParser { public telemetry: Telemetry | undefined; - public rushGlobalFolder!: RushGlobalFolder; + public rushGlobalFolder: RushGlobalFolder; public readonly rushConfiguration!: RushConfiguration; public readonly rushSession: RushSession; public readonly pluginManager: PluginManager; @@ -127,6 +127,8 @@ export class RushCommandLineParser extends CommandLineParser { rushConfiguration: this.rushConfiguration }); + this.rushGlobalFolder = new RushGlobalFolder(); + this.rushSession = new RushSession({ getIsDebugMode: () => this.isDebug, terminalProvider: this._terminalProvider @@ -239,8 +241,6 @@ export class RushCommandLineParser extends CommandLineParser { private _populateActions(): void { try { - this.rushGlobalFolder = new RushGlobalFolder(); - // Alphabetical order this.addAction(new AddAction(this)); this.addAction(new ChangeAction(this));