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 11function 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
38arguments
49 filename (1 ,1 ) string {mustBeNonzeroLengthText }
510 fpath (1 ,: ) string = getenv(' PATH' )
1116 % Windows executable filename doesn't necessarily need .exe,
1217 % particularly for WSL executables that is_exe() will detect from
1318 % native Windows Matlab.
14- if ~endsWith(filename , " .exe" )
19+ if ~endsWith(lower( filename ) , " .exe" )
1520 names(2 ) = filename + " .exe" ;
1621 end
1722end
You can’t perform that action at this time.
0 commit comments