run method

  1. @override
void run()
override

Runs this command.

The return value is wrapped in a Future if necessary and returned by CommandRunner.runCommand.

Implementation

@override
void run() {
  var debug = argResults!['debug'] as bool;

  Settings().setVerbose(enabled: debug);
  Environment().certbotVerbose = debug;

  var config = ConfigYaml();

  config.validate(() => showUsage(argParser));

  if (Containers().findByContainerId(config.containerid!)!.isRunning) {
    var cmd = 'docker exec -it ${config.containerid} /home/bin/acquire ';

    print('');
    print(orange(
        'Please be patient this can take a quite a few minutes to complete'));

    if (debug == true) cmd += ' --debug';
    cmd.run;
  } else {
    printerr(red(
        "The Nginx-LE container ${config.containerid} isn't running. Use 'nginx-le start' to start the container"));
  }
}