2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-08 16:14:12 +00:00

feat: slower alternative for get_required_deps

This commit is contained in:
saxenabhishek 2022-03-14 05:33:44 +05:30
parent adbe19ac1b
commit d0bd294dc2

View File

@ -171,9 +171,14 @@ def get_required_deps(org, name, branch, deps="hooks.py"):
import requests
import base64
url = f"https://api.github.com/repos/{org}/{name}/contents/{name}/{deps}"
git_api_url = f"https://api.github.com/repos/{org}/{name}/contents/{name}/{deps}"
params = {"branch": branch or "develop"}
res = requests.get(url=url, params=params).json()
res = requests.get(url=git_api_url, params=params).json()
if "message" in res:
git_url = f"https://raw.githubusercontent.com/{org}/{name}/{params['branch']}/{deps}"
return requests.get(git_url).text
return base64.decodebytes(res["content"].encode()).decode()