runScript method

Future<int> runScript(
  1. String script, {
  2. String extra = '',
})

Runs a script from the scripts map if it exists.

Implementation

Future<int> runScript(String script, {String extra = ''}) async {
  final preScript = lookup('pre$script');
  if (preScript != null) await _runScript('pre$script');

  final exitCode = _runScript(script, extra: extra);

  final postScript = lookup('post$script');
  if (postScript != null) await _runScript('post$script');

  return exitCode;
}