File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export class CustomCommandFactory {
2121 parser . rushConfiguration . commonRushConfigFolder , RushConstants . commandLineFilename
2222 ) ;
2323 const commandLineConfiguration : CommandLineConfiguration
24- = CommandLineConfiguration . tryLoadFromFile ( commandLineConfigFile ) ;
24+ = CommandLineConfiguration . loadFromFileOrDefault ( commandLineConfigFile ) ;
2525
2626 const documentationForBuild : string = 'The Rush build command assumes that the package.json file for each'
2727 + ' project contains a "scripts" entry for "npm run build". It invokes'
Original file line number Diff line number Diff line change @@ -28,7 +28,12 @@ export class CommandLineConfiguration {
2828 public readonly commands : CommandJson [ ] = [ ] ;
2929 public readonly parameters : ParameterJson [ ] = [ ] ;
3030
31- public static tryLoadFromFile ( jsonFilename : string ) : CommandLineConfiguration {
31+ /**
32+ * Loads the configuration from the specified file. If the file does not exist,
33+ * then an empty default instance is returned. If the file contains errors, then
34+ * an exception is thrown.
35+ */
36+ public static loadFromFileOrDefault ( jsonFilename : string ) : CommandLineConfiguration {
3237 let commandLineJson : ICommandLineJson | undefined = undefined ;
3338 if ( fs . existsSync ( jsonFilename ) ) {
3439 commandLineJson = JsonFile . loadAndValidate ( jsonFilename , CommandLineConfiguration . _jsonSchema ) ;
You can’t perform that action at this time.
0 commit comments