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.yamlin 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.
Extensions
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
nullon unsupported platforms.no setter
Functions
-
applyPositionalArgs(
String script, String extra) → MapEntry< String, String> -
Replaces
$1,$2, etc. inscriptwith positional args fromextra. -
collectVariables(
JsonMap map) → Map< String, String> -
Collects all variable definitions from
mapby 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 inscriptusingvariablesfirst, then Platform.environment as fallback. Unknown variables are left unchanged.