File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
libraries/rush-lib/src/api Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -56,11 +56,15 @@ export interface ICommandLineSpec {
5656 * @beta
5757 */
5858export class RushCommandLine {
59+ private static _commandLineParser : RushCommandLineParser ;
60+
5961 public static getSpec ( workspaceFolder : string ) : ICommandLineSpec [ ] {
60- const commandLineParser : RushCommandLineParser = new RushCommandLineParser ( { cwd : workspaceFolder } ) ;
62+ if ( ! RushCommandLine . _commandLineParser ) {
63+ RushCommandLine . _commandLineParser = new RushCommandLineParser ( { cwd : workspaceFolder } ) ;
64+ }
6165
6266 // Copy the actions
63- const commandLineActions : CommandLineAction [ ] = commandLineParser . actions . slice ( ) ;
67+ const commandLineActions : readonly CommandLineAction [ ] = RushCommandLine . _commandLineParser . actions ;
6468
6569 // extract the set of command line elements from the command line parser
6670 const filledCommandLineActions : ICommandLineSpec [ ] = [ ] ;
You can’t perform that action at this time.
0 commit comments