6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-12 22:27:47 +00:00

fix: do not save the full config on "plugins en/disable"

This was saving the full configuration to config.yml, resulting in many
incorrect configuration values...
This commit is contained in:
Régis Behmo 2021-12-08 13:07:24 +01:00 committed by Régis Behmo
parent d82546adde
commit db818ab4a1

View File

@ -42,7 +42,7 @@ def list_command(context: Context) -> None:
@click.argument("plugin_names", metavar="plugin", nargs=-1)
@click.pass_obj
def enable(context: Context, plugin_names: List[str]) -> None:
config = tutor_config.load_full(context.root)
config = tutor_config.load_minimal(context.root)
for plugin in plugin_names:
plugins.enable(config, plugin)
fmt.echo_info("Plugin {} enabled".format(plugin))
@ -59,7 +59,7 @@ def enable(context: Context, plugin_names: List[str]) -> None:
@click.argument("plugin_names", metavar="plugin", nargs=-1)
@click.pass_obj
def disable(context: Context, plugin_names: List[str]) -> None:
config = tutor_config.load_full(context.root)
config = tutor_config.load_minimal(context.root)
disable_all = "all" in plugin_names
for plugin in plugins.iter_enabled(config):
if disable_all or plugin.name in plugin_names: