Interface IScriptExecutionContext
Assembly: SociallyDistant.Framework.dll
Syntax
public interface IScriptExecutionContext
Properties
FileSystem
Gets a reference to the shell's file system. If null, glob patterns won't be expanded.
Declaration
IVirtualFileSystem? FileSystem { get; }
Property Value
Home
Gets a path to the user's home directory. If null, there is no home directory and '~' characters will not be expanded to it.
Declaration
Property Value
Title
Declaration
Property Value
WorkingDirectory
Gets a path to the current working directory. If none is specified, "/" will be used instead.
Declaration
string? WorkingDirectory { get; }
Property Value
Methods
DeclareFunction(string, IScriptFunction)
Declaration
void DeclareFunction(string name, IScriptFunction body)
Parameters
GetVariableValue(string)
Declaration
string GetVariableValue(string variableName)
Parameters
Type |
Name |
Description |
string |
variableName |
|
Returns
HandleCommandNotFound(string, string[], IConsoleDriver)
Declaration
void HandleCommandNotFound(string name, string[] args, IConsoleDriver console)
Parameters
OpenFileConsole(IConsoleDriver, string, FileRedirectionType)
Declaration
IConsoleDriver OpenFileConsole(IConsoleDriver realConsole, string filePath, FileRedirectionType mode)
Parameters
Returns
SetVariableValue(string, string)
Declaration
void SetVariableValue(string variableName, string value)
Parameters
TryExecuteCommandAsync(string, string[], IConsoleDriver, IScriptExecutionContext?)
Declaration
Task<int?> TryExecuteCommandAsync(string name, string[] args, IConsoleDriver console, IScriptExecutionContext? callSite = null)
Parameters
Returns