mirror of
https://github.com/composer/composer
synced 2025-05-09 16:42:57 +00:00
Fix regression with non-SPDX licenses in show command, refs #3885
This commit is contained in:
parent
99694a0381
commit
921b3a0eba
2 changed files with 13 additions and 5 deletions
|
@ -392,11 +392,15 @@ EOT
|
|||
foreach ($licenses as $licenseId) {
|
||||
$license = $spdxLicense->getLicenseByIdentifier($licenseId); // keys: 0 fullname, 1 osi, 2 url
|
||||
|
||||
// is license OSI approved?
|
||||
if ($license[1] === true) {
|
||||
$out = sprintf('%s (%s) (OSI approved) %s', $license[0], $licenseId, $license[2]);
|
||||
if (!$license) {
|
||||
$out = $licenseId;
|
||||
} else {
|
||||
$out = sprintf('%s (%s) %s', $license[0], $licenseId, $license[2]);
|
||||
// is license OSI approved?
|
||||
if ($license[1] === true) {
|
||||
$out = sprintf('%s (%s) (OSI approved) %s', $license[0], $licenseId, $license[2]);
|
||||
} else {
|
||||
$out = sprintf('%s (%s) %s', $license[0], $licenseId, $license[2]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->getIO()->write('<info>license</info> : ' . $out);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue