mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 17:02:32 -05:00
[Core] Add multiple/external cog paths support (#853)
* WIP cog path manager * Initial working state * Get real reloading working * Type error thingy * And fix the tests * Start UI shit * path reordering * Add install path getter/setter and fix config syntax * Determine bot directory at runtime * Add UI commands for install path * Update downloader to use install path * Add sane install path default * Make evaluation of cog install path lazy * Some typing fixes * Add another line to codeowners * Conditionally put install path in paths * Always put install path first * Dont allow people to add the installdir as an additional path, guarantee install dir isn't shown with paths command * Make shit update loaded cogs * Add tests * Another one
This commit is contained in:
@@ -38,14 +38,12 @@ def init_events(bot, cli_flags):
|
||||
|
||||
for package in packages:
|
||||
try:
|
||||
bot.load_extension(package)
|
||||
spec = bot.cog_mgr.find_cog(package)
|
||||
bot.load_extension(spec)
|
||||
except Exception as e:
|
||||
log.exception("Failed to load package {}".format(package),
|
||||
exc_info=e)
|
||||
failed.append(package)
|
||||
|
||||
if failed:
|
||||
await bot.save_packages_status()
|
||||
await bot.remove_loaded_package(package)
|
||||
if packages:
|
||||
print("Loaded packages: " + ", ".join(packages))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user