From cb5f690cf472b90bf7df4443410e1e89ef8c5446 Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Sat, 12 Jan 2019 10:17:56 -0500 Subject: [PATCH] add git api key support --- sys/apis/git.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/apis/git.lua b/sys/apis/git.lua index c7a5ccc..058f202 100644 --- a/sys/apis/git.lua +++ b/sys/apis/git.lua @@ -5,6 +5,10 @@ local TREE_URL = 'https://api.github.com/repos/%s/%s/git/trees/%s?recursive=1' local FILE_URL = 'https://raw.githubusercontent.com/%s/%s/%s/%s' local git = { } +if _G._GIT_API_KEY then + TREE_URL = TREE_URL .. '&access_token=' .. _G._GIT_API_KEY +end + function git.list(repository) local t = Util.split(repository, '(.-)/')