| 83 | } |
| 84 | |
| 85 | func newDaemonRelaunchCommand(deps commandDeps) *cobra.Command { |
| 86 | return &cobra.Command{ |
| 87 | Use: "relaunch", |
| 88 | Short: "Internal daemon relaunch helper", |
| 89 | Hidden: true, |
| 90 | RunE: func(cmd *cobra.Command, _ []string) error { |
| 91 | homePaths, err := deps.resolveHome() |
| 92 | if err != nil { |
| 93 | return err |
| 94 | } |
| 95 | |
| 96 | return deps.runRelaunchHelper(cmd.Context(), aghdaemon.RelaunchHelperConfig{ |
| 97 | HomePaths: homePaths, |
| 98 | OperationID: strings.TrimSpace(os.Getenv(aghdaemon.RestartOperationEnvKey)), |
| 99 | Executable: deps.executable, |
| 100 | Sandbox: os.Environ(), |
| 101 | }) |
| 102 | }, |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | func newDaemonStopCommand(deps commandDeps) *cobra.Command { |
| 107 | return &cobra.Command{ |