feat(dev): launch browser by default

This commit is contained in:
Thomas Camlong committed 2026-08-01 23:49:23 +02:00
1 parent 406fb4c0b6
commit 3b450eb04a
2 files changed
+14 -1

No files matched your search

+2 -1
View File
@@ -20,6 +20,7 @@ var (
flagEnv []string flagEnv []string
flagDetach bool flagDetach bool
flagBuildPR int flagBuildPR int
runMain = tui.RunDev
) )
func main() { func main() {
@@ -52,7 +53,7 @@ Examples:
homarr doctor # check Docker and optional integrations`, homarr doctor # check Docker and optional integrations`,
Args: cobra.NoArgs, Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help() return runMain()
}, },
} }
+12
View File
@@ -1,10 +1,22 @@
package main package main
import ( import (
"errors"
"strings" "strings"
"testing" "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) { func TestRunLaunchRejectsTagWithPR(t *testing.T) {
previousPR := flagPR previousPR := flagPR
t.Cleanup(func() { flagPR = previousPR }) t.Cleanup(func() { flagPR = previousPR })