Closed eirannejad closed 6 years ago
This is a brilliant idea! It should definitely apply to external scripts - and probably also to the location of the assembly for rpsaddin scripts!
Why didn't I think of this before? I guess I just assumed you'd use the "Search Paths" functionality in the configuration dialog... That is also the point in the code that I would use to add the new code...
yeah that would be amazing if you can implement this.
Seems like this has already been implemented. See ScriptExecutor.cs/ExecuteScript()
// Add script directory address to sys search paths
var path = engine.GetSearchPaths();
path.Add(System.IO.Path.GetDirectoryName(sourcePath));
engine.SetSearchPaths(path);
Oh. Well. Maybe I built a time machine or something? Anyway. Closing :-)
It'll be great if the directory containing the script is added to the sys.path before running the script so the script can load external libraries without manually adding this to the sys.path.