fix: run commands in right order if all
This commit is contained in:
@@ -191,13 +191,30 @@ def _get_operation_config(cmd: str) -> Optional[Dict[str, Any]]:
|
|||||||
return configs.get(cmd)
|
return configs.get(cmd)
|
||||||
|
|
||||||
|
|
||||||
|
COMMAND_EXECUTION_ORDER = [
|
||||||
|
"quotes",
|
||||||
|
"medias",
|
||||||
|
"posts",
|
||||||
|
"likes",
|
||||||
|
"reposts",
|
||||||
|
"follows",
|
||||||
|
"bookmarks",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def run_all(skip_confirmation: bool = False):
|
def run_all(skip_confirmation: bool = False):
|
||||||
logger = get_logger()
|
logger = get_logger()
|
||||||
|
|
||||||
all_commands = registry.get_all_commands()
|
all_commands = registry.get_all_commands()
|
||||||
commands = [cmd for cmd in all_commands.keys()
|
available_commands = [cmd for cmd in all_commands.keys()
|
||||||
if cmd not in ("configure", "all")]
|
if cmd not in ("configure", "all")]
|
||||||
|
|
||||||
|
commands = [cmd for cmd in COMMAND_EXECUTION_ORDER
|
||||||
|
if cmd in available_commands]
|
||||||
|
|
||||||
|
commands.extend([cmd for cmd in available_commands
|
||||||
|
if cmd not in COMMAND_EXECUTION_ORDER])
|
||||||
|
|
||||||
commands_str = ", ".join(commands)
|
commands_str = ", ".join(commands)
|
||||||
all_confirmation = f"run all cleanup commands ({commands_str})"
|
all_confirmation = f"run all cleanup commands ({commands_str})"
|
||||||
require_confirmation(all_confirmation, skip_confirmation)
|
require_confirmation(all_confirmation, skip_confirmation)
|
||||||
|
|||||||
Reference in New Issue
Block a user