RunnableScript class
A runnable script with pre-defined name, cmd and args. May be run using the run
command and optionally
supplying extra arguments to pass.
Constructors
-
RunnableScript(String name, {required String cmd, required List<
String> args, String? description, String? workingDir, Map<String, String> env = const {}, FileSystem? fileSystem, bool displayCmd = false, bool appendNewline = false}) -
A runnable script with pre-defined name, cmd and args. May be run using the
run
command and optionally supplying extra arguments to pass. -
RunnableScript.fromMap(Map<
String, dynamic> map, {FileSystem? fileSystem}) -
Generate a runnable script from a normal map as defined in the config.
factory
Properties
- appendNewline → bool
-
When set to
true
, the command will end with a newline. This is useful for using the output in other scripts.final -
args
→ List<
String> -
The arguments to pass to the script.
final
- cmd → String
-
The command to run the script with.
final
- description → String?
-
The description of the script, used in help messages.
final
- displayCmd → bool
-
When set to
false
, the command will not print "$ ..." before running the command. This is useful for using the output in other scripts.final -
env
→ Map<
String, String> -
The environment variables to run the script in.
This map is appended to the one given in the config.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
The name of the script, as defined in the config.
final
-
preloadScripts
↔ List<
RunnableScript> -
Other scripts in the config which are runnable by this script.
The script loader pre-loads these as temporary aliases to allow combined scripts to be run.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- workingDir → String?
-
The working directory to run the script in.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
[List< String> extraArgs = const []]) → Future<int> - Runs the current script with the given extra arguments.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited