consolidation / robo

Modern task runner for PHP
http://robo.li
Other
2.66k stars 305 forks source link

Issues with passthrough #711

Open FatherShawn opened 6 years ago

FatherShawn commented 6 years ago

Steps to reproduce

My task is similar to that described in #706.

If I execute: vendor/bin/robo --load-from ./scripts/robo drush -- help sapi-i

Also if I move RoboFile.php to the root of the project and execute: vendor/bin/robo drush -- help sapi-i

Associated robo method:

/**
   * Execute a drush command in the cli container.
   *
   * @param string $drush_command
   *   The command.
   */
  public function drush($drush_command) {
    switch (php_uname('s')) {
      case 'Darwin':
        $this->setMacDockerEnv();
        $this->io()->text("Docker config set as $this->dockerConfig");
        break;

      default:
        $this->io()
          ->error("Unable to determine your operating system.");
    }
    $this->taskExec("docker-compose $this->dockerConfig exec cli /var/www/vendor/bin/drush $drush_command")
      ->printMetadata(FALSE)
      ->printOutput(TRUE)
      ->run();
  }

Expected behavior

I should get the help output for the sapi-i command as shown at https://robo.li/getting-started/#pass-through-arguments

Actual behavior

Too many arguments, expected arguments "command" "drush_command".

drush [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--simulate] [--progress-delay PROGRESS-DELAY] [-D|--define DEFINE] [--] <command> <drush_command>

System Configuration

macOS 10.13.4

PHP 7.1.13 (cli) (built: Jan 5 2018 15:30:29) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans

FatherShawn commented 6 years ago

I thought about this overnight. I’m already using robo to move and maintain certain files and I’m also already using ahoy so another way to solve my specific problem is moving an os.ahoy.yml into place as ahoy.yml using robo to select the source file during setup.

That still leaves pass through not working in robo as documented so leaving this open.