ScriptRunnerConfig class
The configuration for a script runner. See each field's documentation for more information.
Constructors
-
ScriptRunnerConfig({required List<
RunnableScript> scripts, ScriptRunnerShellConfig shell = const ScriptRunnerShellConfig(), String? workingDir, Map<String, String> ? env, FileSystem? fileSystem, int lineLength = 80, String? configSource}) -
Create a new script runner config from given arguments.
Usually you would not want to call this, and instead load the config from a file using
ScriptRunnerConfig.get()
.
Properties
- configSource ↔ String?
-
The source file path of the config. Might be null if the config was created from the constructor manually.
getter/setter pair
-
env
→ Map<
String, String> ? -
Map of optional override environment variables for the scripts to run in.
final
- fileSystem → FileSystem?
-
The filesystem used for loading scripts.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- lineLength → int
-
The length of the lines in the help description, which causes text overflowing to the next line when necessary.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scripts
→ List<
RunnableScript> -
The list of scripts in the config.
final
-
scriptsMap
→ Map<
String, RunnableScript> -
A map of the registered scripts, keyed by name.
no setter
- shell → ScriptRunnerShellConfig
-
The shell to use for running scripts. You may provide any executable path here.
final
- workingDir → String?
-
The default working directory for the scripts to run in.
If left
null
, defaults to current directory.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
printBuiltins(
[String search = '']) → void - Prints the list of scripts in the config.
-
printScripts(
[String search = '']) → void - Prints the list of scripts in the config.
-
printUsage(
) → void - Prints usage help text for this config
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
[FileSystem? fileSystem]) → Future< ScriptRunnerConfig> -
Loads the script runner configuration from the current directory.
You may give it a
FileSystem
to use, or it will use the default local one.