|
74 | 74 |
|
75 | 75 | elseif hasCliNwbInspector
|
76 | 76 | reportFilePath = [tempname, '.json'];
|
77 |
| - systemCommand = sprintf('%s %s --levels importance --json-file-path %s', ... |
78 |
| - nwbInspectorExecutable, nwbFilepath, reportFilePath); |
79 |
| - |
| 77 | + if isunix |
| 78 | + systemCommand = sprintf('%s %s --levels importance --json-file-path %s', ... |
| 79 | + nwbInspectorExecutable, nwbFilepath, reportFilePath); |
| 80 | + elseif ispc |
| 81 | + % Use double quotes in case there are spaces in the filepaths |
| 82 | + systemCommand = sprintf('"%s" "%s" --levels importance --json-file-path "%s"', ... |
| 83 | + nwbInspectorExecutable, nwbFilepath, reportFilePath); |
| 84 | + end |
80 | 85 | [status, m] = system(systemCommand);
|
81 | 86 |
|
82 | 87 | assert(status == 0, ...
|
|
190 | 195 | if isunix
|
191 | 196 | systemCommand = sprintf('which %s', nwbInspectorExecutable);
|
192 | 197 | elseif ispc
|
193 |
| - systemCommand = sprintf('where %s', nwbInspectorExecutable); |
| 198 | + if isfile([nwbInspectorExecutable, '.exe']) |
| 199 | + % If the nwbexecutable exists as a file, we have the absolute |
| 200 | + % path and don't need to check with the where command |
| 201 | + isNwbInspectorInstalled = true; |
| 202 | + return |
| 203 | + else |
| 204 | + systemCommand = sprintf('where "%s"', nwbInspectorExecutable); |
| 205 | + end |
194 | 206 | end
|
195 | 207 | assert(logical(exist('systemCommand', 'var')), ...
|
196 | 208 | 'Unknown platform, could not generate system command. Please report!')
|
197 | 209 | [status, ~] = system(systemCommand);
|
| 210 | + |
198 | 211 | isNwbInspectorInstalled = status == 0;
|
199 | 212 | end
|
0 commit comments