File tree Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -64,8 +64,8 @@ export abstract class BaseInstallAction extends BaseRushAction {
64
64
this . _maxInstallAttempts = this . defineIntegerParameter ( {
65
65
parameterLongName : '--max-install-attempts' ,
66
66
argumentName : 'NUMBER' ,
67
- description : `Overrides the default maximum number of install attempts.`
68
- + ` The default value is ${ RushConstants . defaultMaxInstallAttempts } .`
67
+ description : `Overrides the default maximum number of install attempts.` ,
68
+ defaultValue : RushConstants . defaultMaxInstallAttempts
69
69
} ) ;
70
70
this . _variant = this . defineStringParameter ( Variants . VARIANT_PARAMETER ) ;
71
71
}
@@ -104,7 +104,9 @@ export abstract class BaseInstallAction extends BaseRushAction {
104
104
}
105
105
}
106
106
107
- if ( this . _maxInstallAttempts . value && this . _maxInstallAttempts . value < 1 ) {
107
+ // Because the 'defautltValue' option on the _maxInstallAttempts parameter is set,
108
+ // it is safe to assume that the value is not null
109
+ if ( this . _maxInstallAttempts . value ! < 1 ) {
108
110
throw new Error ( `The value of "${ this . _maxInstallAttempts . longName } " must be positive.` ) ;
109
111
}
110
112
Original file line number Diff line number Diff line change 4
4
import { BaseInstallAction } from './BaseInstallAction' ;
5
5
import { IInstallManagerOptions } from '../../logic/InstallManager' ;
6
6
import { RushCommandLineParser } from '../RushCommandLineParser' ;
7
- import { RushConstants } from '../../logic/RushConstants' ;
8
7
9
8
export class InstallAction extends BaseInstallAction {
10
9
public constructor ( parser : RushCommandLineParser ) {
@@ -36,9 +35,9 @@ export class InstallAction extends BaseInstallAction {
36
35
networkConcurrency : this . _networkConcurrencyParameter . value ,
37
36
collectLogFile : this . _debugPackageManagerParameter . value ! ,
38
37
variant : this . _variant . value ,
39
- maxInstallAttempts : this . _maxInstallAttempts . value !== undefined
40
- ? this . _maxInstallAttempts . value
41
- : RushConstants . defaultMaxInstallAttempts
38
+ // Because the 'defautltValue' option on the _maxInstallAttempts parameter is set,
39
+ // it is safe to assume that the value is not null
40
+ maxInstallAttempts : this . _maxInstallAttempts . value !
42
41
} ;
43
42
}
44
43
}
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import { CommandLineFlagParameter } from '@microsoft/ts-command-line';
6
6
import { BaseInstallAction } from './BaseInstallAction' ;
7
7
import { IInstallManagerOptions } from '../../logic/InstallManager' ;
8
8
import { RushCommandLineParser } from '../RushCommandLineParser' ;
9
- import { RushConstants } from '../../logic/RushConstants' ;
10
9
11
10
export class UpdateAction extends BaseInstallAction {
12
11
private _fullParameter : CommandLineFlagParameter ;
@@ -64,9 +63,9 @@ export class UpdateAction extends BaseInstallAction {
64
63
networkConcurrency : this . _networkConcurrencyParameter . value ,
65
64
collectLogFile : this . _debugPackageManagerParameter . value ! ,
66
65
variant : this . _variant . value ,
67
- maxInstallAttempts : this . _maxInstallAttempts . value !== undefined
68
- ? this . _maxInstallAttempts . value
69
- : RushConstants . defaultMaxInstallAttempts
66
+ // Because the 'defautltValue' option on the _maxInstallAttempts parameter is set,
67
+ // it is safe to assume that the value is not null
68
+ maxInstallAttempts : this . _maxInstallAttempts . value !
70
69
} ;
71
70
}
72
71
}
Original file line number Diff line number Diff line change @@ -1086,7 +1086,7 @@ export class InstallManager {
1086
1086
if ( environmentVariables [ envVar ] . override &&
1087
1087
environmentVariables [ envVar ] . override === true ) {
1088
1088
setEnvironmentVariable = true ;
1089
- console . log ( colors . yellow ( `WARNING: Overriding the environment variable with the value set in rush.json.`) ) ;
1089
+ console . log ( ` Overriding the environment variable with the value set in rush.json.`) ;
1090
1090
}
1091
1091
else {
1092
1092
console . log ( colors . yellow ( `WARNING: Not overriding the value of the environment variable.` ) ) ;
You can’t perform that action at this time.
0 commit comments