Skip to content

Commit

Permalink
Fix execution of xgettext under Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Mar 29, 2017
1 parent e214971 commit 1e7ae2b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Parser/Php.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1e7ae2b

Please sign in to comment.