on main help sign in
chore(windows): remove warning
68e1130Andrey Nering
main.go−19
@@ -5,8 +5,6 @@ import (
5 "log/slog"
5 "log/slog"
6 "net/http"
6 "net/http"
7 "os"
7 "os"
8− "runtime"
9− "strings"
10
8
11 _ "net/http/pprof" // profiling
9 _ "net/http/pprof" // profiling
12
10
@@ -14,14 +12,9 @@ import (
14
12
15 "github.com/charmbracelet/crush/internal/cmd"
13 "github.com/charmbracelet/crush/internal/cmd"
16 "github.com/charmbracelet/crush/internal/log"
14 "github.com/charmbracelet/crush/internal/log"
17− "github.com/charmbracelet/lipgloss/v2"
18)
15)
19
16
20func main() {
17func main() {
21− if runtime.GOOS == "windows" {
22− showWindowsWarning()
23− }
24−
25 defer log.RecoverPanic("main", func() {
18 defer log.RecoverPanic("main", func() {
26 slog.Error("Application terminated due to unhandled panic")
19 slog.Error("Application terminated due to unhandled panic")
27 })
20 })
@@ -37,15 +30,3 @@ func main() {
37
30
38 cmd.Execute()
31 cmd.Execute()
39}
32}
40−
41−func showWindowsWarning() {
42− content := strings.Join([]string{
43− lipgloss.NewStyle().Bold(true).Render("WARNING:") + " Crush is experimental on Windows!",
44− "While we work on it, we recommend WSL2 for a better experience.",
45− lipgloss.NewStyle().Italic(true).Render("Press Enter to continue..."),
46− }, "\n")
47− fmt.Print(content)
48−
49− var input string
50− fmt.Scanln(&input)
51−}