diff --git a/cmd/archduino/main.go b/cmd/archduino/main.go index 58120d1..c5e7b82 100644 --- a/cmd/archduino/main.go +++ b/cmd/archduino/main.go @@ -37,7 +37,8 @@ var version = "dev" // modules, wired against the provided config and platform dependencies. // It replaces the earlier init()-time hello-module registration now that // the real modules need runtime config to be instantiated. -func buildRegistry(cfg config.Config) (*module.Registry, error) { +func buildRegistry(cfg config.Config, themeID string) (*module.Registry, error) { + _ = themeID // reserved for Task 7 (neovim.New wiring); unused until then reg := module.NewRegistry() runner := platform.ExecRunner{} pm := platform.NewPacman(runner) @@ -122,7 +123,7 @@ func newInstallCmd() *cobra.Command { return err } - reg, err := buildRegistry(cfg) + reg, err := buildRegistry(cfg, "") if err != nil { return fmt.Errorf("build registry: %w", err) } @@ -183,6 +184,13 @@ func newInstallCmd() *cobra.Command { fmt.Fprintln(os.Stdout, "installation cancelled") return nil } + // Rebuild the registry with the theme the user chose in the + // wizard so theme-aware modules (e.g. neovim in Task 7) pick + // up the selection instead of the empty pre-wizard default. + reg, err = buildRegistry(cfg, finalState.ThemeID) + if err != nil { + return fmt.Errorf("build registry: %w", err) + } // Either the CLI flag or the wizard toggle can force halt-on-error. sum, runErr = dashboard.Run(ctx, reg, finalState, halt || finalState.HaltOnError) }