File tree Expand file tree Collapse file tree 1 file changed +25
-13
lines changed
src/extension/ui/src/utils Expand file tree Collapse file tree 1 file changed +25
-13
lines changed Original file line number Diff line number Diff line change @@ -36,19 +36,31 @@ let user: string | null = null;
36
36
37
37
export const getUser = async ( client : v1 . DockerDesktopClient ) => {
38
38
if ( user == null ) {
39
- const result = await tryRunImageSync ( client , [
40
- "--rm" ,
41
- "--network=none" ,
42
- "-e" ,
43
- "USER" ,
44
- BUSYBOX ,
45
- "/bin/sh" ,
46
- "-c" ,
47
- client . host . platform === "win32"
48
- ? `\"echo $USER\"`
49
- : `'echo $USER'` ,
50
- ] ) ;
51
- user = result . trim ( ) ;
39
+ if ( client . host . platform === "win32" ) {
40
+ const result = await tryRunImageSync ( client , [
41
+ "--rm" ,
42
+ "--network=none" ,
43
+ "-e" ,
44
+ "USERNAME" ,
45
+ BUSYBOX ,
46
+ "/bin/sh" ,
47
+ "-c" ,
48
+ `\"echo $USERNAME\"` ,
49
+ ] ) ;
50
+ user = result . trim ( ) ;
51
+ } else {
52
+ const result = await tryRunImageSync ( client , [
53
+ "--rm" ,
54
+ "--network=none" ,
55
+ "-e" ,
56
+ "USER" ,
57
+ BUSYBOX ,
58
+ "/bin/sh" ,
59
+ "-c" ,
60
+ `'echo $USER'` ,
61
+ ] ) ;
62
+ user = result . trim ( ) ;
63
+ }
52
64
}
53
65
return user ;
54
66
} ;
You can’t perform that action at this time.
0 commit comments