1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-01-05 14:50:29 +02:00

Win: Prompt download Chrome if not installed

This commit is contained in:
Chen-I Lim 2021-01-20 19:49:35 -08:00
parent a88f9592d8
commit 1db75f1142

View File

@ -34,14 +34,14 @@ func main() {
// log.Printf("PID: %s", strconv.FormatInt(int64(os.Getpid()), 10))
hideConsole()
if len(lorca.ChromeExecutable) == 0 {
lorca.PromptDownload()
log.Fatal("Chrome not installed")
}
ctx, cancel := context.WithCancel(context.Background())
cmd := runOctoTasks(ctx)
chromePath := locateChrome()
if len(chromePath) > 0 {
os.Setenv("LORCACHROME", chromePath)
}
ui, err := lorca.New("http://localhost:8088", "", 1024, 768)
if err != nil {
log.Fatal(err)
@ -118,3 +118,14 @@ func locateChrome() string {
return ""
}
// set LORCACHROME for Lorca to pick up at init time
func setLorcaChromeLocation() {
chromePath := locateChrome()
log.Printf("chromePath: %s", chromePath)
if len(chromePath) > 0 {
os.Setenv("LORCACHROME", chromePath)
}
}
setLorcaChromeLocation()