Skip to content

Commit 3530129

Browse files
fix: shelljs.homedir() is not a function
running `loadFromDefault` with wsl2 and the existing code never loads the `.kube/config` from your home directory since shelljs.homedir() is not a function. I tested using `~/.kube/config` using wsl2 and Ubuntu 20.04 and it works as expected.
1 parent e632ad8 commit 3530129

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export class KubeConfig {
304304
if (process.platform === 'win32' && shelljs.which('wsl.exe')) {
305305
// TODO: Handle if someome set $KUBECONFIG in wsl here...
306306
try {
307-
const result = execa.sync('wsl.exe', ['cat', shelljs.homedir() + '/.kube/config']);
307+
const result = execa.sync('wsl.exe', ['cat', '~/.kube/config']);
308308
if (result.exitCode === 0) {
309309
this.loadFromString(result.stdout, opts);
310310
return;

0 commit comments

Comments
 (0)