OS determination in CommandExist is giving wrong result for remote servers.
For example if I'm trying to deploy from Windows-based machine to Unix-based one i'm receiving following error message:
The command "ssh [email protected] "where /usr/local/bin/composer"" failed.
That's happening because of the check
private function isWindows() : bool
{
return '\\' === DIRECTORY_SEPARATOR;
}
in CommandExists.php:40 which is only valid for local PHP instance and not for remote host.
Which linux flavour are you deploying to?
This command also fails for me at the exact same point to a centos 7.3 vps, but on further investigation I realised the where command on centos is actually whereis
$shellCommand = sprintf('%s %s', $this->isWindows() ? 'where' : 'which', $this->commandName);
https://github.com/EasyCorp/easy-deploy-bundle/blob/master/src/Requirement/CommandExists.php#L33
Replace where by whereis and things proceed as expected.
I'm using Ubuntu Server, so which is enough for me.
But we can also use command -v {$this->commandName} or type -p {$this->commandName} as well.
Or use them as a fallback.
i'm having the same problem... shouldn't the server type (ie : windows or linux) be configurable ?
Same problem ! Local OS is Windows, remote OS is Linux, which results in command not found error :-(.
Same problem, any updates ?