@@ -517,15 +517,18 @@ export function bufferFromFileOrString(file?: string, data?: string): Buffer | n
517517}
518518
519519function dropDuplicatesAndNils ( a : string [ ] ) : string [ ] {
520- return a . reduce ( ( acceptedValues , currentValue ) => {
521- // Good-enough algorithm for reducing a small (3 items at this point) array into an ordered list
522- // of unique non-empty strings.
523- if ( currentValue && ! acceptedValues . includes ( currentValue ) ) {
524- return acceptedValues . concat ( currentValue ) ;
525- } else {
526- return acceptedValues ;
527- }
528- } , [ ] as string [ ] ) ;
520+ return a . reduce (
521+ ( acceptedValues , currentValue ) => {
522+ // Good-enough algorithm for reducing a small (3 items at this point) array into an ordered list
523+ // of unique non-empty strings.
524+ if ( currentValue && ! acceptedValues . includes ( currentValue ) ) {
525+ return acceptedValues . concat ( currentValue ) ;
526+ } else {
527+ return acceptedValues ;
528+ }
529+ } ,
530+ [ ] as string [ ] ,
531+ ) ;
529532}
530533
531534// Only public for testing.
@@ -542,8 +545,10 @@ export function findHomeDir(): string | null {
542545 }
543546 // $HOME is always favored, but the k8s go-client prefers the other two env vars
544547 // differently depending on whether .kube/config exists or not.
545- const homeDrivePath = process . env . HOMEDRIVE && process . env . HOMEPATH ?
546- path . join ( process . env . HOMEDRIVE , process . env . HOMEPATH ) : '' ;
548+ const homeDrivePath =
549+ process . env . HOMEDRIVE && process . env . HOMEPATH
550+ ? path . join ( process . env . HOMEDRIVE , process . env . HOMEPATH )
551+ : '' ;
547552 const homePath = process . env . HOME || '' ;
548553 const userProfile = process . env . USERPROFILE || '' ;
549554 const favourHomeDrivePathList : string [ ] = dropDuplicatesAndNils ( [ homePath , homeDrivePath , userProfile ] ) ;
@@ -560,7 +565,7 @@ export function findHomeDir(): string | null {
560565 for ( const dir of favourUserProfileList ) {
561566 try {
562567 const lstat = fs . lstatSync ( dir ) ;
563- // tslint:disable-next-line:no-bitwise
568+ // tslint:disable-next-line:no-bitwise
564569 if ( lstat && ( lstat . mode & fs . constants . S_IXUSR ) === fs . constants . S_IXUSR ) {
565570 return dir ;
566571 }
0 commit comments