(ctx context.Context, deps commandDeps, runtime *runtimeContext)
| 194 | } |
| 195 | |
| 196 | func stopDaemonForUninstall(ctx context.Context, deps commandDeps, runtime *runtimeContext) (bool, error) { |
| 197 | info, running, err := daemonInfo(runtime.HomePaths, deps) |
| 198 | if err != nil { |
| 199 | return false, err |
| 200 | } |
| 201 | if !running { |
| 202 | return false, nil |
| 203 | } |
| 204 | if err := deps.signalProcess(info.PID, syscall.SIGTERM); err != nil { |
| 205 | if errors.Is(err, os.ErrProcessDone) || errors.Is(err, syscall.ESRCH) { |
| 206 | return true, nil |
| 207 | } |
| 208 | return false, fmt.Errorf("cli: stop daemon for uninstall: %w", err) |
| 209 | } |
| 210 | if _, err := waitForDaemonStop(ctx, deps, runtime, info); err != nil { |
| 211 | return false, err |
| 212 | } |
| 213 | return true, nil |
| 214 | } |
| 215 | |
| 216 | func removeRuntimeArtifacts(homePaths aghconfig.HomePaths) ([]string, error) { |
| 217 | candidates := []string{ |
no test coverage detected