BadScript 2
Loading...
Searching...
No Matches
BadContainerRuntimeExtensions.cs
Go to the documentation of this file.
2
4{
5 public static class BadContainerRuntimeExtensions
6 {
8 {
9 var fs = stack.Create();
10 var rt = runtime
11 .Clone()
12 .ConfigureModuleImporter(i => i.Clear())
14 .UseFileSystemApi(fs);
15
16 return rt.ExecuteFile("main.bs", fs);
17 }
18 }
19}
Exposes the BadScript Runtime Functionality to Consumers.
Definition BadRuntime.cs:30
BadRuntime Clone()
Clone this Runtime.
BadRuntime UseLocalModules(IFileSystem? fs=null)
Registers the Local Path Handler to the Module Importer.
BadRuntime ConfigureModuleImporter(Action< BadExecutionContext, string, BadModuleImporter > action)
Configures the Module Importer.
BadRuntimeExecutionResult ExecuteFile(string file, IFileSystem? fileSystem=null)
Executes the specified script file.
static BadRuntimeExecutionResult RunContainer(this BadRuntime runtime, BadFileSystemStack stack)
BadLayeredFileSystem Create(bool createWritable=false)
Contains IO Extensions and APIs for the BadScript2 Runtime.
Gets returned by the bad runtime when an execution is finished.