File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1- function exe = which(filename , fpath )
1+ function exe = which(filename , fpath , use_java )
22%% which()
33% like Python shutil.which, find executable in fpath or env var PATH
44% does not resolve path.
88arguments
99 filename (1 ,1 ) string {mustBeNonzeroLengthText }
1010 fpath (1 ,: ) string = getenv(' PATH' )
11+ use_java (1 ,1 ) logical = false
1112end
1213
1314names = filename ;
2425% directory/filename given
2526for exe = names
2627
27- if stdlib .is_absolute(exe ) && stdlib .is_exe(exe )
28+ if stdlib .is_absolute(exe , use_java ) && stdlib .is_exe(exe , use_java )
2829 return
2930 end
3031
4748
4849 for p = fpath
4950 exe = stdlib .join(p , name );
50- if stdlib .is_exe(exe )
51+ if stdlib .is_exe(exe , use_java )
5152 return
5253 end
5354 end
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ function test_is_exe_which_wsl(tc)
3535
3636tc .verifyTrue(stdlib .is_exe(out ), " is_exe() failed to detect WSL executable " + out )
3737
38- wsl_exe = stdlib .which(out );
38+ wsl_exe = stdlib .which(out , [], true );
3939tc .verifyNotEmpty(wsl_exe , " which() failed to detect WSL executable " + out )
4040
4141end
You can’t perform that action at this time.
0 commit comments