[Downloader] Handle git not installed (#1002)

This commit is contained in:
Twentysix 2017-10-20 05:37:57 +02:00 committed by palmtree5
parent 39a0f25774
commit 65b2e77b65

View File

@ -20,6 +20,7 @@ REPO_NONEX = 0x1
REPO_CLONE = 0x2
REPO_SAME = 0x4
REPOS_LIST = "https://twentysix26.github.io/Red-Docs/red_cog_approved_repos/"
WINDOWS_OS = os.name == 'nt'
DISCLAIMER = ("You're about to add a 3rd party repository. The creator of Red"
" and its community have no responsibility for any potential "
@ -99,6 +100,15 @@ class Downloader:
"valid.")
del self.repos[repo_name]
return
except FileNotFoundError:
error_message = ("I couldn't find git. The downloader needs it "
"for it to properly work.")
if WINDOWS_OS:
error_message += ("\nIf you just installed it you may need "
"a reboot for it to be seen into the PATH "
"environment variable.")
await self.bot.say(error_message)
return
self.populate_list(repo_name)
self.save_repos()
data = self.get_info_data(repo_name)