@@ -162,29 +162,27 @@ export class CreateOrUpdateEnvironmentFileDriver implements StepDriver {
162
162
envKey : string ,
163
163
envValue : string
164
164
) : Promise < Result < Void , FxError > > {
165
- if ( ! envValue ) {
166
- return ok ( Void ) ;
167
- }
168
-
169
- const placeHolderReg = / \$ { { \s * ( [ a - z A - Z _ ] [ a - z A - Z 0 - 9 _ ] * ) \s * } } / ;
170
- const matches = placeHolderReg . exec ( envValue ) ;
171
- if ( matches != null && matches . length > 1 ) {
172
- const envVarName = matches [ 1 ] ;
173
- const config =
174
- envVarConfigs . find ( ( c ) => c . envKey === envKey ) || getGenericEnvVarConfig ( envKey ) ;
165
+ if ( envValue ) {
166
+ const placeHolderReg = / \$ { { \s * ( [ a - z A - Z _ ] [ a - z A - Z 0 - 9 _ ] * ) \s * } } / ;
167
+ const matches = placeHolderReg . exec ( envValue ) ;
168
+ if ( matches != null && matches . length > 1 ) {
169
+ const envVarName = matches [ 1 ] ;
170
+ const config =
171
+ envVarConfigs . find ( ( c ) => c . envKey === envKey ) || getGenericEnvVarConfig ( envKey ) ;
175
172
176
- const result = await ctx . ui ?. inputText ( {
177
- name : config . question . name ,
178
- title : config . question . title as string ,
179
- password : config . isPassword || config . question . password ,
180
- validation : config . validation ,
181
- } ) ;
173
+ const result = await ctx . ui ?. inputText ( {
174
+ name : config . question . name ,
175
+ title : config . question . title as string ,
176
+ password : config . isPassword || config . question . password ,
177
+ validation : config . validation ,
178
+ } ) ;
182
179
183
- if ( result ?. isErr ( ) ) {
184
- return result ;
185
- } else if ( result ?. isOk ( ) && result . value . result ) {
186
- envOutput . set ( envVarName , result . value . result ) ;
187
- args . envs [ envKey ] = result . value . result ;
180
+ if ( result ?. isErr ( ) ) {
181
+ return result ;
182
+ } else if ( result ?. isOk ( ) && result . value . result ) {
183
+ envOutput . set ( envVarName , result . value . result ) ;
184
+ args . envs [ envKey ] = result . value . result ;
185
+ }
188
186
}
189
187
}
190
188
return ok ( Void ) ;
0 commit comments