Skip to content

Commit

Permalink
windows ENV problems
Browse files Browse the repository at this point in the history
  • Loading branch information
jrushlow committed Feb 3, 2024
1 parent bb9ef3a commit 0af0b55
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Util/TemplateLinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ public function lintPhpTemplate(string|array $templateFilePath): void
foreach ($templateFilePath as $filePath) {
$cmdPrefix = $this->needsPhpCmdPrefix ? 'php ' : '';

$process = Process::fromShellCommandline(sprintf('PHP_CS_FIXER_IGNORE_ENV=1 %s%s --config=%s --using-cache=no fix %s', $cmdPrefix, $this->phpCsFixerBinaryPath, $this->phpCsFixerConfigPath, $filePath));
if (str_contains(strtolower(\PHP_OS), 'win')) {
$process = Process::fromShellCommandline(sprintf('set PHP_CS_FIXER_IGNORE_ENV=1&%s%s --config=%s --using-cache=no fix %s', $cmdPrefix, $this->phpCsFixerBinaryPath, $this->phpCsFixerConfigPath, $filePath));
} else {
$process = Process::fromShellCommandline(sprintf('PHP_CS_FIXER_IGNORE_ENV=1 %s%s --config=%s --using-cache=no fix %s', $cmdPrefix, $this->phpCsFixerBinaryPath, $this->phpCsFixerConfigPath, $filePath));
}

$stat = $process->run();

Expand Down

0 comments on commit 0af0b55

Please sign in to comment.