kopia lustrzana https://github.com/badgen/badgen.net
fix(travis): support new default branch naming convention
rodzic
a37cceb2e5
commit
09862c1e32
|
@ -12,12 +12,13 @@ export default createBadgenHandler({
|
|||
}
|
||||
})
|
||||
|
||||
async function handler ({ user, repo, branch = 'master' }: PathArgs) {
|
||||
const com = `https://api.travis-ci.com/${user}/${repo}.svg?branch=${branch}`
|
||||
const org = `https://api.travis-ci.org/${user}/${repo}.svg?branch=${branch}`
|
||||
async function handler ({ user, repo, branch }: PathArgs) {
|
||||
const badgePath = `${user}/${repo}.svg`
|
||||
const searchParams = new URLSearchParams()
|
||||
if (branch) searchParams.append('branch', branch)
|
||||
const [svg1, svg2] = await Promise.all([
|
||||
got(com).text(),
|
||||
got(org).text()
|
||||
got(badgePath, { prefixUrl: 'https://api.travis-ci.com', searchParams }).text(),
|
||||
got(badgePath, { prefixUrl: 'https://api.travis-ci.org', searchParams }).text()
|
||||
])
|
||||
|
||||
const result = statuses.find(([status]) => {
|
||||
|
|
Ładowanie…
Reference in New Issue