mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[Downloader] Handle git not installed (#1002)
This commit is contained in:
parent
39a0f25774
commit
65b2e77b65
@ -20,6 +20,7 @@ REPO_NONEX = 0x1
|
|||||||
REPO_CLONE = 0x2
|
REPO_CLONE = 0x2
|
||||||
REPO_SAME = 0x4
|
REPO_SAME = 0x4
|
||||||
REPOS_LIST = "https://twentysix26.github.io/Red-Docs/red_cog_approved_repos/"
|
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"
|
DISCLAIMER = ("You're about to add a 3rd party repository. The creator of Red"
|
||||||
" and its community have no responsibility for any potential "
|
" and its community have no responsibility for any potential "
|
||||||
@ -99,6 +100,15 @@ class Downloader:
|
|||||||
"valid.")
|
"valid.")
|
||||||
del self.repos[repo_name]
|
del self.repos[repo_name]
|
||||||
return
|
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.populate_list(repo_name)
|
||||||
self.save_repos()
|
self.save_repos()
|
||||||
data = self.get_info_data(repo_name)
|
data = self.get_info_data(repo_name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user