File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
function win_path = wslpath2winpath(wsl_path )
2
2
%% wslpath2winpath(wsl_path)
3
3
% Convert a WSL path to a Windows path
4
+ % PATH MUST EXIST IN WSL
4
5
% output format is like \\wsl$\Ubuntu\home\username\...
5
6
arguments (Input )
6
7
wsl_path (1 ,1 ) string {mustBeNonzeroLengthText }
Original file line number Diff line number Diff line change @@ -49,7 +49,9 @@ function test_wsl_path(tc)
49
49
wsl_temp = stdlib .sys .wsl_tempfile();
50
50
tc .verifyNotEmpty(wsl_temp , " could not get WSL tempfile" )
51
51
52
- wsl_path = stdlib .wslpath2winpath(wsl_temp );
52
+ wsl_path = stdlib .wslpath2winpath(" ~" );
53
+ % can't use wsl_temp as new WSL spawned might have erased it.
54
+ tc .verifyNotEqual(wsl_path , " ~" )
53
55
tc .verifyTrue(stdlib .is_wsl_path(wsl_path ), " could not convert WSL path to Windows path" )
54
56
55
57
win_path = stdlib .winpath2wslpath(wsl_path );
You can’t perform that action at this time.
0 commit comments