Phase 5-7: README, Makefile, unit tests
- README.md: full usage docs - Makefile: build/install/uninstall/test/lint/clean targets - config/config_test.go: 7 tests (load, save, find, add, roundtrip, invalid yaml) - runtime/runtime_test.go: 6 tests (get, available, ListRunning graceful degradation) - systemd/generator_test.go: 7 tests (ServiceName, Generate system/user/custom/docker/unknown, buildExecCommands) - fix: docker/podman ListRunning returns nil (not error) when daemon unavailable - fix: invalid YAML test uses tab-indent which is genuinely unparseable
This commit is contained in:
@@ -26,7 +26,8 @@ func (d *Docker) ListRunning() ([]Container, error) {
|
||||
|
||||
out, err := exec.Command(bin, "ps", "--format", "json").Output()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("docker ps: %w", err)
|
||||
// Docker installed but daemon not running — treat as no containers
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// Docker outputs one JSON object per line (not a JSON array)
|
||||
|
||||
Reference in New Issue
Block a user