Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force system specific vendor path
Browse files Browse the repository at this point in the history
veewee committed Oct 4, 2019

Verified

This commit was signed with the committer’s verified signature.
veewee Toon Verwerft
1 parent 5040359 commit 2156bbd
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/Composer/GrumPHPPlugin.php
Original file line number Diff line number Diff line change
@@ -216,12 +216,7 @@ function (string $argument): string {
1 => array('file', 'php://stdout', 'w'),
2 => array('file', 'php://stderr', 'w'),
),
$pipes = [],
null,
null,
[
'bypass_shell' => true,
]
$pipes = []
);

// Check executable which is running:
@@ -251,12 +246,9 @@ function (string $argument): string {
private function detectGrumphpExecutable(): ?string
{
$config = $this->composer->getConfig();
$binDir = $config->get('bin-dir');
$binDir = $this->ensurePlatformSpecificDirectorySeparator((string) $config->get('bin-dir'));
$suffixes = ['.phar', '', '.bat'];


var_dump(getcwd(), $binDir, scandir($binDir));exit;

return array_reduce(
$suffixes,
function (?string $carry, string $suffix) use ($binDir): ?string {
@@ -270,6 +262,11 @@ function (?string $carry, string $suffix) use ($binDir): ?string {
);
}

private function ensurePlatformSpecificDirectorySeparator(string $path): string
{
return str_replace('/', DIRECTORY_SEPARATOR, $path);
}

private function pluginErrored(string $reason)
{
$this->io->writeError('<fg=red>GrumPHP can not sniff your commits! ('.$reason.')</fg=red>');

0 comments on commit 2156bbd

Please sign in to comment.