MDL-43461 behat: Using linux-style directory separators when using cygwin
This commit is contained in:
@@ -66,10 +66,26 @@ class behat_command {
|
||||
|
||||
/**
|
||||
* Returns the executable path
|
||||
*
|
||||
* Allows returning a customized command for cygwin when the
|
||||
* command is just displayed, when using exec(), system() and
|
||||
* friends we stay with DIRECTORY_SEPARATOR as they use the
|
||||
* normal cmd.exe (in Windows).
|
||||
*
|
||||
* @param bool $custombyterm If the provided command should depend on the terminal where it runs
|
||||
* @return string
|
||||
*/
|
||||
public final static function get_behat_command() {
|
||||
return 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'behat';
|
||||
public final static function get_behat_command($custombyterm = false) {
|
||||
|
||||
$separator = DIRECTORY_SEPARATOR;
|
||||
$exec = 'behat';
|
||||
|
||||
// Cygwin uses linux-style directory separators.
|
||||
if ($custombyterm && testing_is_cygwin()) {
|
||||
$exec = 'behat.bat';
|
||||
$separator = '/';
|
||||
}
|
||||
return 'vendor' . $separator . 'bin' . $separator . $exec;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user