From 3b450eb04a3fbc3f9f84690ec9cf51d16d1d0ef9 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Sat, 1 Aug 2026 23:48:24 +0200 Subject: [PATCH] feat(dev): launch browser by default --- tools/homarr-dev/main.go | 3 ++- tools/homarr-dev/main_test.go | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/homarr-dev/main.go b/tools/homarr-dev/main.go index 0bd295d8b..2380e41bd 100644 --- a/tools/homarr-dev/main.go +++ b/tools/homarr-dev/main.go @@ -20,6 +20,7 @@ var ( flagEnv []string flagDetach bool flagBuildPR int + runMain = tui.RunDev ) func main() { @@ -52,7 +53,7 @@ Examples: homarr doctor # check Docker and optional integrations`, Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { - return cmd.Help() + return runMain() }, } diff --git a/tools/homarr-dev/main_test.go b/tools/homarr-dev/main_test.go index c1806075d..1736d98b3 100644 --- a/tools/homarr-dev/main_test.go +++ b/tools/homarr-dev/main_test.go @@ -1,10 +1,22 @@ package main import ( + "errors" "strings" "testing" ) +func TestRootCommandLaunchesDevelopmentDashboard(t *testing.T) { + want := errors.New("dashboard started") + previous := runMain + t.Cleanup(func() { runMain = previous }) + runMain = func() error { return want } + + if err := rootCmd.RunE(rootCmd, nil); !errors.Is(err, want) { + t.Fatalf("root command error = %v", err) + } +} + func TestRunLaunchRejectsTagWithPR(t *testing.T) { previousPR := flagPR t.Cleanup(func() { flagPR = previousPR })