Skip to content

Commit

Permalink
Fix "Unknown downloader type: npm-signature" exception. Issue: fxpio#321
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaporozhec7 authored and another-one-studio committed Apr 21, 2018
1 parent 61352d9 commit 06273c7
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Converter/NpmPackageUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,22 @@ private static function convertDistEntry(array &$value, $type, $url)

if ('shasum' === $type) {
$value[$type] = $url;
} else {
$value['type'] = 'tarball' === $type ? 'tar' : $type;
} elseif('tarball' === $type) {
$value['type'] = 'tar';
$value['url'] = $url;
} elseif(in_array($type, self::getDownloaderTypes(), true)) {
$value['type'] = $type;
$value['url'] = $url;
}
}

/**
* Get downloader types in Composer.
*
* @return array
*/
private static function getDownloaderTypes()
{
return ['git', 'svn', 'fossil', 'hg', 'perforce', 'zip', 'rar', 'tar', 'gzip', 'xz', 'phar', 'file', 'path'];
}
}

0 comments on commit 06273c7

Please # to comment.