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 {
543
543
}
544
544
return null ;
545
545
}
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
547
547
// differently depending on whether .kube/config exists or not.
548
548
const homeDrivePath =
549
549
process . env . HOMEDRIVE && process . env . HOMEPATH
@@ -564,11 +564,8 @@ export function findHomeDir(): string | null {
564
564
// 2. ...the first of %HOME%, %USERPROFILE%, %HOMEDRIVE%%HOMEPATH% that exists and is writeable is returned
565
565
for ( const dir of favourUserProfileList ) {
566
566
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 ;
572
569
// tslint:disable-next-line:no-empty
573
570
} catch ( ignore ) { }
574
571
}
You can’t perform that action at this time.
0 commit comments