ScriptRunCommand constructor

ScriptRunCommand({
  1. required ScriptsYaml scriptsYaml,
  2. required Variables variables,
  3. required Bindings bindings,
  4. required Logger logger,
  5. required CWD cwd,
})

Implementation

ScriptRunCommand({
  required this.scriptsYaml,
  required this.variables,
  required this.bindings,
  required this.logger,
  required this.cwd,
}) : argParser = AnyArgParser() {
  addFlags();

  argParser.addFlag(
    'help',
    abbr: 'h',
    negatable: false,
    help: 'Prints usage information.',
  );

  argParser.addFlag(
    'bail',
    negatable: false,
    help: 'Stop on first error',
  );

  argParser.addFlag(
    'never-exit',
    negatable: false,
    help: '!!${red.wrap('USE WITH CAUTION')}!!!\n'
        'After the script is done, the command will '
        'restart after a 1 second delay.\n'
        'This is useful for long running scripts that '
        'should always be running.',
    aliases: ['never-quit'],
  );

  argParser.addFlag(
    'concurrent',
    aliases: ['parallel', 'c', 'p'],
    abbr: 'c',
    help: 'Runs all scripts concurrently. --no-concurrent will turn off '
        'concurrency even if set in the scripts.yaml',
  );
}