Skip to content

Commit

Permalink
feat: add else block for package relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
szaleq committed Apr 25, 2024
1 parent e984ffd commit 52a4f64
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Composer/ComposerPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace BrianHenryIE\Strauss\Composer;

use BrianHenryIE\Strauss\Helpers\Path;
use Composer\Composer;
use Composer\Factory;
use Composer\IO\NullIO;
Expand Down Expand Up @@ -128,6 +129,8 @@ public function __construct(Composer $composer, array $overrideAutoload = null)
} elseif (1 === preg_match('/.*\/([^\/]*\/[^\/]*)\/composer.json/', $composerJsonFileAbsolute, $output_array)) {
// Not every package gets installed to a folder matching its name (crewlabs/unsplash).
$this->relativePath = $output_array[1];
} else {
$this->relativePath = Path::normalize($this->packageName);
}

if (!is_null($overrideAutoload)) {
Expand Down

0 comments on commit 52a4f64

Please sign in to comment.