File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,9 +208,12 @@ export class RushConfiguration {
208208
209209 public static loadFromDefaultLocation ( ) : RushConfiguration {
210210 const rushJsonLocation : string | undefined = RushConfiguration . tryFindRushJsonLocation ( ) ;
211- return rushJsonLocation
212- ? RushConfiguration . loadFromConfigurationFile ( rushJsonLocation )
213- : Utilities . throwRushConfigNotFoundError ( ) ;
211+
212+ if ( rushJsonLocation ) {
213+ return RushConfiguration . loadFromConfigurationFile ( rushJsonLocation ) ;
214+ } else {
215+ throw Utilities . getRushConfigNotFoundError ( ) ;
216+ }
214217 }
215218
216219 /**
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ export abstract class BaseRushAction extends CommandLineAction {
6363 process . exitCode = 1 ;
6464
6565 if ( ! this . rushConfiguration ) {
66- Utilities . throwRushConfigNotFoundError ( ) ;
66+ throw Utilities . getRushConfigNotFoundError ( ) ;
6767 }
6868
6969 this . _ensureEnvironment ( ) ;
Original file line number Diff line number Diff line change @@ -10,8 +10,6 @@ import * as path from 'path';
1010import * as wordwrap from 'wordwrap' ;
1111import { JsonFile , IPackageJson } from '@microsoft/node-core-library' ;
1212
13- import { RushConfiguration } from '../api/RushConfiguration' ;
14-
1513export interface IEnvironment {
1614 // NOTE: the process.env doesn't actually support "undefined" as a value.
1715 // If you try to assign it, it will be converted to the text string "undefined".
@@ -515,8 +513,8 @@ export class Utilities {
515513 }
516514 }
517515
518- public static throwRushConfigNotFoundError ( ) : RushConfiguration {
519- throw new Error ( 'Unable to find rush.json configuration file' ) ;
516+ public static getRushConfigNotFoundError ( ) : Error {
517+ return new Error ( 'Unable to find rush.json configuration file' ) ;
520518 }
521519
522520 /**
You can’t perform that action at this time.
0 commit comments