File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
function exe = which(filename , fpath )
2
- %% which like Python shutil.which, find executable in fpath or env var PATH
2
+ %% which()
3
+ % like Python shutil.which, find executable in fpath or env var PATH
4
+ % does not resolve path.
5
+ % That is, can return relative path if executable is in:
6
+ % * (Windows) in cwd
7
+ % * (all) fpath or Path contains relative paths
3
8
arguments
4
9
filename (1 ,1 ) string {mustBeNonzeroLengthText }
5
10
fpath (1 ,: ) string = getenv(' PATH' )
11
16
% Windows executable filename doesn't necessarily need .exe,
12
17
% particularly for WSL executables that is_exe() will detect from
13
18
% native Windows Matlab.
14
- if ~endsWith(filename , " .exe" )
19
+ if ~endsWith(lower( filename ) , " .exe" )
15
20
names(2 ) = filename + " .exe" ;
16
21
end
17
22
end
You can’t perform that action at this time.
0 commit comments