Added PyPI license support
This commit is contained in:
parent
0baa320968
commit
358c690b10
|
@ -127,6 +127,11 @@ I made the GitHub Badge Service.
|
|||
<td><img src='//img.shields.io/cocoapods/p/AFNetworking.svg' alt='' /></td>
|
||||
<td><code>http://img.shields.io/cocoapods/p/AFNetworking.svg</code></td>
|
||||
</tr>
|
||||
<tr><th> PyPI (License): </th>
|
||||
<td><img src='//img.shields.io/pypi/l/Django.svg' alt=''/></td>
|
||||
<td><code>http://img.shields.io/pypi/l/Django.svg</code></td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
<h3> Build </h3>
|
||||
<table><tbody>
|
||||
|
|
11
server.js
11
server.js
|
@ -684,6 +684,17 @@ cache(function(data, match, sendBadge) {
|
|||
badgeData.colorscheme = 'blue';
|
||||
}
|
||||
sendBadge(format, badgeData);
|
||||
} else if (info == 'l') {
|
||||
var license = data.info.license;
|
||||
badgeData.text[0] = 'license';
|
||||
if(license == null || license == 'UNKNOWN') {
|
||||
badgeData.text[1] = 'Unknown';
|
||||
badgeData.colorscheme = 'red';
|
||||
} else {
|
||||
badgeData.text[1] = license;
|
||||
badgeData.colorscheme = 'blue';
|
||||
}
|
||||
sendBadge(format, badgeData);
|
||||
}
|
||||
} catch(e) {
|
||||
badgeData.text[1] = 'invalid';
|
||||
|
|
Loading…
Reference in New Issue
Block a user