Tried running MBeautify.formatFiles('test','*.m') from a folder containing a folder test with some m-files in it and MBeautify.formatFile(file, file) failed to find the file that was already found.
Since dir provides a struct including the full (absolute) folder path I just replaced directory with that information. In the code all structs in the files array will have the same string as folder so
I guess the same could be done by adding
if numel(files) > 0 directory = files(1).folder end
but that would not allow for any future feature that allows multiple directories as input.
Tried running MBeautify.formatFiles('test','*.m') from a folder containing a folder test with some m-files in it and MBeautify.formatFile(file, file) failed to find the file that was already found.
Since dir provides a struct including the full (absolute) folder path I just replaced directory with that information. In the code all structs in the files array will have the same string as folder so
I guess the same could be done by adding
if numel(files) > 0 directory = files(1).folder end
but that would not allow for any future feature that allows multiple directories as input.