Prexonite, a .NET hosted scripting language with a focus on meta-programming and embedded DSLs
0

Configure Feed

Select the types of activity you want to include in your feed.

Allow relative paths for main module

Christian Klauser (Jan 21, 2022, 7:20 PM +0100) 2e150d50 2562f1c1

+10 -1
+10 -1
Prx/src/prx_main.pxs
··· 239 239 var plan = host.self_assembling_build_plan; 240 240 var prx_path = host.prx_path; 241 241 plan.SearchPaths.Add(System::IO::Path.Combine(prx_path, "psr", "_2")); 242 - plan.SearchPaths.Add(System::Environment.CurrentDirectory); 242 + if(sourceFiles.Count > 0) { 243 + if( System::IO::File.Exists(var lastSourceFile = sourceFiles[sourceFiles.Count - 1]) 244 + && (var dir = System::IO::Path.GetDirectoryName(lastSourceFile)) is not null) { 245 + // translate to full path to force resolution as file (instead of ref-spec) 246 + sourceFiles[sourceFiles.Count - 1] = System::IO::Path.GetFullPath(lastSourceFile); 247 + plan.SearchPaths.Add(dir); 248 + } else { 249 + plan.SearchPaths.Add(System::Environment.CurrentDirectory); 250 + } 251 + } 243 252 searchPaths >> each(plan.SearchPaths.Add(?)); 244 253 245 254 //Report