File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -543,7 +543,7 @@ export function findHomeDir(): string | null {
543543 }
544544 return null ;
545545 }
546- // $HOME is always favored , but the k8s go-client prefers the other two env vars
546+ // $HOME is always favoured , but the k8s go-client prefers the other two env vars
547547 // differently depending on whether .kube/config exists or not.
548548 const homeDrivePath =
549549 process . env . HOMEDRIVE && process . env . HOMEPATH
@@ -564,11 +564,8 @@ export function findHomeDir(): string | null {
564564 // 2. ...the first of %HOME%, %USERPROFILE%, %HOMEDRIVE%%HOMEPATH% that exists and is writeable is returned
565565 for ( const dir of favourUserProfileList ) {
566566 try {
567- const lstat = fs . lstatSync ( dir ) ;
568- // tslint:disable-next-line:no-bitwise
569- if ( lstat && ( lstat . mode & fs . constants . S_IXUSR ) === fs . constants . S_IXUSR ) {
570- return dir ;
571- }
567+ fs . accessSync ( dir , fs . constants . W_OK ) ;
568+ return dir ;
572569 // tslint:disable-next-line:no-empty
573570 } catch ( ignore ) { }
574571 }
You can’t perform that action at this time.
0 commit comments