Skip to content

Commit

Permalink
fixed artifactory bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
simialbi committed Oct 12, 2022
1 parent 8819d34 commit 91cd2a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/Repository/AbstractAssetRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,6 @@ abstract class AbstractAssetRepository implements ConfigurableRepositoryInterfac
*/
public function __construct(array $repoConfig, PartialComposer $composer, IOInterface $io, Config $config, HttpDownloader $httpDownloader, ?EventDispatcher $eventDispatcher)
{
$this->repoConfig = $repoConfig;
$this->composer = $composer;
$this->io = $io;
$this->config = $config;
$this->httpDownloader = $httpDownloader;
$this->eventDispatcher = $eventDispatcher;
$this->loader = new ArrayLoader();
$this->cache = new Cache($io, $config->get('cache-repo-dir') . '/' . Preg::replace('{[^a-z0-9.]}i', '-', Url::sanitize($this->getUrl())), 'a-z0-9.$~');
$this->cache->setReadOnly($config->get('cache-read-only'));
if (isset($repoConfig['options'])) {
$this->options = $repoConfig['options'];
}
Expand All @@ -85,6 +76,15 @@ public function __construct(array $repoConfig, PartialComposer $composer, IOInte
if (isset($repoConfig['search-url'])) {
$this->searchUrl = $repoConfig['search-url'];
}
$this->repoConfig = $repoConfig;
$this->composer = $composer;
$this->io = $io;
$this->config = $config;
$this->httpDownloader = $httpDownloader;
$this->eventDispatcher = $eventDispatcher;
$this->loader = new ArrayLoader();
$this->cache = new Cache($io, $config->get('cache-repo-dir') . '/' . Preg::replace('{[^a-z0-9.]}i', '-', Url::sanitize($this->getUrl())), 'a-z0-9.$~');
$this->cache->setReadOnly($config->get('cache-read-only'));
}

/**
Expand Down
7 changes: 6 additions & 1 deletion src/Repository/BowerArtifactoryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,15 @@ protected function convertPackage(array $item): array

foreach ($refs as $ref) {
if (Preg::match('#^([a-f\d]{44})\s+refs/tags/(\S+)#', $ref, $matches)) {
try {
$v = $versionParser->normalize($matches[2]);
} catch (\UnexpectedValueException) {
continue;
}
$results[] = [
'name' => 'bower-asset/' . $item['name'],
'version' => $matches[2],
'version_normalized' => $versionParser->normalize($matches[2]),
'version_normalized' => $v,
'dist' => [
'type' => 'tar',
'url' => $this->getUrl() . '/binaries/' . $cleanedUrl . '.git/' . $matches[2]
Expand Down

0 comments on commit 91cd2a7

Please sign in to comment.