* chore: upgrade to Eslint v9 * fix remaining issues * more type fixes * resolve remaining issues * use wdio eslint package * PR feedback
16 lines
661 B
TypeScript
16 lines
661 B
TypeScript
const githubReadme = '/README.md'
|
|
const githubHost = 'https://github.com/'
|
|
const githubRawHost = 'https://raw.githubusercontent.com/'
|
|
|
|
/**
|
|
* Download README.md from github
|
|
* @param {string} githubUrl github url to project
|
|
* @param {string} location file location in repo
|
|
* @return {Promise<string>} readme content
|
|
*/
|
|
export async function downloadFromGitHub(githubUrl: string, branch: string, location = githubReadme) {
|
|
const url = `${githubUrl}/${branch}/${location}`.replace(githubHost, githubRawHost)
|
|
console.log(`Downloading: ${url}`)
|
|
const res = await fetch(url)
|
|
return await res.text()
|
|
}
|