2026-11-10 01:24:28 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"cursor/internal/app"
|
2026-11-10 09:59:34 +08:00
|
|
|
"cursor/internal/buildinfo"
|
2026-11-10 01:24:28 +08:00
|
|
|
"cursor/internal/logger"
|
|
|
|
|
"embed"
|
2026-11-10 09:59:34 +08:00
|
|
|
"fmt"
|
2026-11-10 01:24:28 +08:00
|
|
|
"os"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
//go:embed all:frontend/dist
|
|
|
|
|
var assets embed.FS
|
|
|
|
|
|
|
|
|
|
//go:embed build/appicon.png
|
|
|
|
|
var appIcon []byte
|
|
|
|
|
|
|
|
|
|
//go:embed build/tray.png
|
|
|
|
|
var trayIcon []byte
|
|
|
|
|
|
|
|
|
|
func main() {
|
2026-11-10 09:59:34 +08:00
|
|
|
disableAutoStart := false
|
|
|
|
|
for _, arg := range os.Args[1:] {
|
|
|
|
|
if arg == "--version" {
|
|
|
|
|
fmt.Println(buildinfo.CurrentVersion())
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if arg == "--no-auto-start" {
|
|
|
|
|
disableAutoStart = true
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-11-10 01:24:28 +08:00
|
|
|
logger.Init()
|
|
|
|
|
if err := app.Run(app.EmbeddedResources{
|
2026-11-10 09:59:34 +08:00
|
|
|
DisableAutoStart: disableAutoStart,
|
|
|
|
|
Assets: assets,
|
|
|
|
|
AppIcon: appIcon,
|
|
|
|
|
TrayIcon: trayIcon,
|
2026-11-10 01:24:28 +08:00
|
|
|
}); err != nil {
|
|
|
|
|
logger.Errorf("app run failed: %v", err)
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
}
|