(deps commandDeps)
| 765 | } |
| 766 | |
| 767 | func newConfigReloadCommand(deps commandDeps) *cobra.Command { |
| 768 | cmd := &cobra.Command{ |
| 769 | Use: configReloadCommandName, |
| 770 | Short: "Reconcile config.toml with the daemon active generation", |
| 771 | Args: cobra.NoArgs, |
| 772 | RunE: func(cmd *cobra.Command, _ []string) error { |
| 773 | client, err := clientFromDeps(deps) |
| 774 | if err != nil { |
| 775 | return fmt.Errorf("cli: create daemon client for config reload: %w", err) |
| 776 | } |
| 777 | result, err := client.ReloadSettings(cmd.Context()) |
| 778 | if err != nil { |
| 779 | return fmt.Errorf("cli: reload config via daemon settings surface: %w", err) |
| 780 | } |
| 781 | return writeCommandOutput(cmd, configSetBundle(configSetRecord{ |
| 782 | Path: "config.toml", |
| 783 | Value: configReloadCommandName, |
| 784 | Scope: string(aghconfig.WriteScopeGlobal), |
| 785 | Target: "daemon", |
| 786 | Lifecycle: string(result.Lifecycle), |
| 787 | ApplyRecordID: result.ApplyRecordID, |
| 788 | Applied: result.Applied, |
| 789 | ActiveGeneration: result.ActiveGeneration, |
| 790 | ActiveConfigHash: result.ActiveConfigHash, |
| 791 | NextAction: string(result.NextAction), |
| 792 | RestartRequired: result.RestartRequired, |
| 793 | RestartScope: result.RestartScope, |
| 794 | })) |
| 795 | }, |
| 796 | } |
| 797 | return cmd |
| 798 | } |
| 799 | |
| 800 | func newConfigApplyHistoryCommand(deps commandDeps) *cobra.Command { |
| 801 | var status string |
no test coverage detected