utils library

Classes

Definition
A typical script definition.
Info
Package information which includes package name & version with both being String.
Pubspec
A singleton class that reads and caches the content of pubspec.yaml in current directory and provides utilities for .
Reference
A helper class to represent a reference to a script.
ScriptsRegistry
A class that holds scripts and provides utilities to work with them.

Constants

aliasesDefinitionKey → const String
Key used to define aliases for a script.
defaultDefinitionKey → const String
Key used to define a default script for a nested command group.
descriptionDefinitionKey → const String
Key used to define script description.
linuxDefinitionKey → const String
Platform-specific script keys.
macosDefinitionKey → const String
pubspecFileName → const String
referenceNestingDelimiter → const String
referencePrefix → const String
scriptsDefinitionKey → const String
Key used to define scripts.
scriptsKey → const String
variablesDefinitionKey → const String
Key used to define reusable variables for script interpolation.
windowsDefinitionKey → const String
workdirDefinitionKey → const String
Key used to set the working directory for a script.

Properties

currentPlatformKey String?
Returns the metadata key for the current OS, or null on unsupported platforms.
no setter

Functions

applyPositionalArgs(String script, String extra) MapEntry<String, String>
Replaces $1, $2, etc. in script with positional args from extra.
collectVariables(JsonMap map) Map<String, String>
Collects all variable definitions from map by scanning for (variables) sections at every nesting level. Later definitions override earlier ones.
readYamlMap(String filePath) Future<Map>
Reads and returns a yaml file if exists and if the content is a map.
substituteVariables(String script, Map<String, String> variables) String
Replaces ${VAR} tokens in script using variables first, then Platform.environment as fallback. Unknown variables are left unchanged.

Typedefs

JsonMap = Map<String, dynamic>
Json serializable map.