File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -230,18 +230,21 @@ function lookupOrInstallCertutil(installCertutil: boolean): boolean | string {
230
230
debug ( 'on mac, looking for homebrew (the only method for install nss supported by devcert' ) ;
231
231
if ( commandExists ( 'brew' ) ) {
232
232
let nssPath : string ;
233
+ let certutilPath : string ;
233
234
try {
234
- let certutilPath = path . join ( run ( 'brew --prefix nss' ) . toString ( ) , 'bin' , 'certutil' ) ;
235
- debug ( `Found nss installed at ${ certutilPath } ` ) ;
236
- return certutilPath ;
235
+ certutilPath = path . join ( run ( 'brew --prefix nss' ) . toString ( ) . trim ( ) , 'bin' , 'certutil' ) ;
237
236
} catch ( e ) {
238
237
debug ( 'brew was found, but nss is not installed' ) ;
239
238
if ( installCertutil ) {
240
239
debug ( 'attempting to install nss via brew' ) ;
241
240
run ( 'brew install nss' ) ;
242
- return path . join ( run ( 'brew --prefix nss' ) . toString ( ) , 'bin' , 'certutil' ) ;
241
+ certutilPath = path . join ( run ( 'brew --prefix nss' ) . toString ( ) . trim ( ) , 'bin' , 'certutil' ) ;
242
+ } else {
243
+ return false ;
243
244
}
244
245
}
246
+ debug ( `Found nss installed at ${ certutilPath } ` ) ;
247
+ return certutilPath ;
245
248
}
246
249
} else if ( isLinux ) {
247
250
debug ( 'on linux, checking is nss is already installed' ) ;
@@ -255,7 +258,7 @@ function lookupOrInstallCertutil(installCertutil: boolean): boolean | string {
255
258
}
256
259
}
257
260
debug ( 'looks like nss is installed' ) ;
258
- return run ( 'which certutil' ) . toString ( ) ;
261
+ return run ( 'which certutil' ) . toString ( ) . trim ( ) ;
259
262
}
260
263
return false ;
261
264
}
You can’t perform that action at this time.
0 commit comments