dispatchrun / dispatch

Entrypoint of the Dispatch ecosystem.
11 stars 1 forks source link

Global dependencies passed to commands #61

Open guergabo opened 3 months ago

guergabo commented 3 months ago

Problem

Part of being able to add more unit tests for issue https://github.com/dispatchrun/dispatch/issues/58 and run them concurrently involves removing/reducing the number of shared global dependencies.

Solution

We could do this by avoiding a command's logic from calling global variables directly and instead pass them a copy to a command's constructor in the cli.Main.

Here is an example for the switch command: https://github.com/dispatchrun/dispatch/pull/60