-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manually link to composer-bin-plugin installed commands
Otherwise there is no guarantee which version of the library the link was created for, as there might be still multiple versions installed. The plugin will link to the first one that was installed. It might not be the one we expected. i.e. rector installed phpstan in version 0.11.3 as one of its dependencies. phpstan 0.11.4 was also directly requested to be installed in a different composer-bin-plugin namespace. Since rectors phpstan was installed first, the link was pointing to the 0.11.3 version instead of 0.11.4 we expected. As a consequence no phpstan plugins could be loaded.
- Loading branch information
Showing
12 changed files
with
249 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Zalas\Toolbox\Tool\Command; | ||
|
||
use Zalas\Toolbox\Tool\Command; | ||
|
||
final class ComposerBinPluginLinkCommand implements Command | ||
{ | ||
private $source; | ||
private $target; | ||
private $namespace; | ||
|
||
public function __construct(string $source, string $target, string $namespace) | ||
{ | ||
$this->source = $source; | ||
$this->target = $target; | ||
$this->namespace = $namespace; | ||
} | ||
|
||
public function __toString(): string | ||
{ | ||
return \sprintf( | ||
'ln -sf ${COMPOSER_HOME:-"~/.composer"}/vendor-bin/%s/vendor/bin/%s %s', | ||
$this->namespace, | ||
$this->source, | ||
$this->target | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.