Skip to content

Commit

Permalink
chore: debug alpha tag script
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Jun 8, 2020
1 parent 2a198db commit 232e37f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/packages/fetch-engine/src/getLatestAlphaTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,23 @@ async function getFirstExistingCommit(commits: string[]): Promise<string> {
}

async function urlExists(url) {
console.log(`Checking ${url}`)
try {
const res = await fetch(url, {
method: 'HEAD',
agent: getProxyAgent(url),
})

const headers = Object.fromEntries(res.headers.entries())
if (res.status > 200) {
console.error(res, headers)
}
if (parseInt(headers['content-length']) > 0) {
return res.status < 300
}
} catch (e) {
//
console.error(e)
}
return false
}

0 comments on commit 232e37f

Please sign in to comment.