Change run command default path

This commit is contained in:
Anton Medvedev 2020-10-26 22:27:46 +01:00
parent 9d725ede63
commit 235ab61ad5

View File

@ -14,6 +14,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface as Input;
use Symfony\Component\Console\Input\InputOption as Option;
use Symfony\Component\Console\Output\OutputInterface as Output;
use function Deployer\has;
use function Deployer\run;
class RunCommand extends SelectCommand
@ -57,6 +58,9 @@ class RunCommand extends SelectCommand
$this->applyOverrides($hosts, $input->getOption('option'));
$task = new Task($command, function () use ($command) {
if (has('current_path')) {
$command = "cd {{current_path}}; $command";
}
run($command);
});