anishathalye / dotbot

A tool that bootstraps your dotfiles ⚡️
MIT License
6.9k stars 287 forks source link

Duplicate directives when custom plugins import builtins #357

Open aananiadis opened 4 months ago

aananiadis commented 4 months ago

If a plugin is added that imports dotbot.plugins (such as dotbot-if) the built-in plugins will be included multiple times and then duplicate execution of the directives.

Example (tested with dotbot version 1.20.1): With dotbot-if in dotbot-plugins directory, and the following config:

- shell:
    - description: Demo shell
      command: echo "Should run once"
$ dotbot/bin/dotbot -c test.conf.yaml -p dotbot-plugins/dotbot-if/if.py
Demo shell [echo "Should run once"]
All commands have been executed
Demo shell [echo "Should run once"]
All commands have been executed

==> All tasks executed successfully

Perhaps the Dispatcher should dedupe the plugin list, or plugin module loading could ignore builtins?