diff --git a/internal/apply/home_links.go b/internal/apply/home_links.go index 7c359c9..414076c 100644 --- a/internal/apply/home_links.go +++ b/internal/apply/home_links.go @@ -42,6 +42,8 @@ var homes = func() []string { for home := range accountsOfHomes() { out = append(out, home) } + // In one order: the user database is read into a map, and a map's order is not one. + sort.Strings(out) return out } diff --git a/internal/apply/home_links_test.go b/internal/apply/home_links_test.go index 041500b..97a47e3 100644 --- a/internal/apply/home_links_test.go +++ b/internal/apply/home_links_test.go @@ -196,7 +196,7 @@ func TestHomesAreAPersonsOrAnAgentsNotAServicesOrRoots(t *testing.T) { passwdFile = passwd t.Cleanup(func() { passwdFile = was }) got := strings.Join(homes(), ",") - if got != "/home/operator,/home/agent,/home/svc" { + if got != "/home/agent,/home/operator,/home/svc" { t.Fatalf("homes %s", got) } if homeAbove("/home/agent/.claude") != "/home/agent" || homeAbove("/home/agent") != "" ||