-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Action shell not handled
#1
Comments
Using pdb I found that we end up here as Edit. Lines 41 to 46 in 2b4dc56
will initialize without passing in any https://github.com/anishathalye/dotbot/blob/328bcb32590e5057b09bd27a40bc2fb21385fbf3/dotbot/cli.py#L149-L155 So this makes sense: no I would assume this did work before though. Maybe something in the dotbot Dispatcher code changes recently so that plugins now must be passed explicitly, and before it was automagical? Edit2. |
Just as a PoC, this minimal diff in this plugin enables the Dotbot built-in plugins: --- a/if.py
+++ b/if.py
@@ -2,6 +2,8 @@ import subprocess
import dotbot
from dotbot.dispatcher import Dispatcher
+from dotbot.plugins import Clean, Create, Link, Shell
+
class If(dotbot.Plugin):
@@ -38,10 +40,12 @@ class If(dotbot.Plugin):
def _run_internal(self, data):
+ plugins = [Clean, Create, Link, Shell]
dispatcher = Dispatcher(
self._context.base_directory(),
only=self._context.options().only,
skip=self._context.options().skip,
options=self._context.options(),
+ plugins=plugins
)
return dispatcher.dispatch(data) Now it's possible to use Of course this is not a full solution, as it does not load any plugins from Maybe that logic could be extracted to a helper in the Dotbot project, or maybe there's a way for this plugin to access the original dispatcher and re-use or fetch the plugin list from there? @kurtmckee (tagging as of anishathalye/dotbot@b5499c7) would you know if there's an easy way for a Dotbot plugin to create a |
Cross-posted to anishathalye/dotbot#339 @erikw Thanks for pinging me on this, and sorry for the late reply! I made the changes in the mentioned commit so that it was possible to test dotbot in a single pytest run. Previously, the unit tests were implemented as bash scripts running in a virtual environment managed by vagrant. This design had the benefit of separating dotbot tests from the user's actual filesystem, but precluded any possibility of testing dotbot on platforms other than Linux. I modified the plugin loading code as a part of a significant effort to move dotbot's test suite to pytest. This new plugin-loading design had the benefit that plugins wouldn't remain permanently loaded between dotbot runs, which allowed the test suite to better exercise dotbot's failure/fallback codepaths when a directive wasn't implemented by a plugin. However, it appears to have broken some functionality that plugins were relying on. 😞 I'll take some time to refamiliarize myself with the plugin loading and the code paths these plugins were relying on. My hope is that there's a simple way to add the lost functionality back in and still maintain isolation of plugin loading between tests (or, possibly, force plugins to unload during test teardown perhaps). |
anishathalye/dotbot#343 should resolve this, and should make this dispatch pattern easier for plugins in the future by exposing a Dispatcher instance with the correct configuration so plugins can easily re-dispatch to other plugins. |
@kurtmckee many thanks! I can confirm that with anishathalye/dotbot#343 this plugin dotbot-if is working with the sample config in the issue description here! 🚀 |
Hello @erikw and everyone, I have opened a pull request on a temporary fix borrowed from Cheers! |
Hey,
using the latest version of this plugin and a doubt installation configuration containing only the partially modified example from this README:
then running
./install
gives meWhat could be wrong here? I tried other actions than
shell
but I get the same output.The text was updated successfully, but these errors were encountered: