Closed ehennestad closed 2 years ago
Hi Eivind, thank you for the suggestion. Just to better understand your usecase, do you have the basepath of the plugin in your path and then call set_path? I am currently using run() when I have to register the toolbox paths from wihin a script. Best wishes, Philipp
I have a simple "addonmanager" as part of Nansen, and users can choose to download flow_registration using this addonmanager. When the package is downloaded, I add it's directory to matlab's savepath, I call the set_path method.
However, I don't cd into the flow_registration directory, so the pwd command in set_path will fail. I was also thinking that hardcoding the '/' file separator might fail on Windows, but I haven't tested that.
1) I didn't realize that calling run() with a file path would be different than running a script directly, but if I use run(...) instead it works! 2) Tested on windows and file separator worked :)
run still works with your suggested solution and it is cleaner in case somebody runs set_path accidentally a second time so I have added the modifaction. Best wishes, Philipp
Hi Philipp,
I have a suggestion for the
set_path
function:This way the
set_path
function can be run from any directory, or from a different script.Best regards, Eivind