Skip to content

Commit

Permalink
Add support for env vars and ~ (for HOME) in repo paths for vcs and a…
Browse files Browse the repository at this point in the history
…rtifact repositories, fixes composer#11409 (composer#11453)
  • Loading branch information
Seldaek committed May 7, 2023
1 parent cbb7319 commit 3bb191a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Composer/Repository/ArtifactRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Composer\Package\BasePackage;
use Composer\Package\Loader\ArrayLoader;
use Composer\Package\Loader\LoaderInterface;
use Composer\Util\Platform;
use Composer\Util\Tar;
use Composer\Util\Zip;

Expand Down Expand Up @@ -46,7 +47,7 @@ public function __construct(array $repoConfig, IOInterface $io)
}

$this->loader = new ArrayLoader();
$this->lookup = $repoConfig['url'];
$this->lookup = Platform::expandPath($repoConfig['url']);
$this->io = $io;
$this->repoConfig = $repoConfig;
}
Expand Down
3 changes: 2 additions & 1 deletion src/Composer/Repository/VcsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Composer\Package\Loader\InvalidPackageException;
use Composer\Package\Loader\LoaderInterface;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Util\Platform;
use Composer\Util\ProcessExecutor;
use Composer\Util\HttpDownloader;
use Composer\Util\Url;
Expand Down Expand Up @@ -90,7 +91,7 @@ public function __construct(array $repoConfig, IOInterface $io, Config $config,
'svn' => 'Composer\Repository\Vcs\SvnDriver',
];

$this->url = $repoConfig['url'];
$this->url = Platform::expandPath($repoConfig['url']);
$this->io = $io;
$this->type = $repoConfig['type'] ?? 'vcs';
$this->isVerbose = $io->isVerbose();
Expand Down

0 comments on commit 3bb191a

Please sign in to comment.