diff --git a/src/Parser/Php.php b/src/Parser/Php.php index 2b99a5d..a82edd4 100644 --- a/src/Parser/Php.php +++ b/src/Parser/Php.php @@ -124,7 +124,11 @@ protected static function parseDirectoryDo_xgettext($rootDirectory, $phpFiles) if ($tempFilePot === false) { throw new \Exception(t('Unable to create a temporary file')); } - $line = 'cd '.escapeshellarg($rootDirectory); + if (DIRECTORY_SEPARATOR === '\\') { + $line = 'cd /D '.escapeshellarg(str_replace('/', '\\', $rootDirectory)); + } else { + $line = 'cd '.escapeshellarg($rootDirectory); + } $line .= ' && xgettext'; $line .= ' --default-domain=messages'; // Domain $line .= ' --output='.escapeshellarg(basename($tempFilePot)); // Output .pot file name