From 13e08840b6870a0491fa1f69191b6c11e80c4aef Mon Sep 17 00:00:00 2001 From: Chen-I Lim Date: Tue, 13 Apr 2021 11:20:21 -0700 Subject: [PATCH] Fix linux app compile --- linux/main.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/linux/main.go b/linux/main.go index 4c6ef9ad5..34d9779e4 100644 --- a/linux/main.go +++ b/linux/main.go @@ -14,13 +14,20 @@ import ( ) var sessionToken string = "su-" + uuid.New().String() -var serverExecutable string = filepath.Join(filepath.Dir(os.Executable()), "focalboard-server") func runServer(ctx context.Context) { + executable, err := os.Executable() + if err != nil { + log.Println("Failed to get os.Executable()") + log.Fatal(err) + } + + serverExecutable := filepath.Join(filepath.Dir(executable), "focalboard-server") + cmd := exec.CommandContext(ctx, serverExecutable, "--monitorpid", strconv.FormatInt(int64(os.Getpid()), 10), "-single-user") cmd.Env = []string{fmt.Sprintf("FOCALBOARD_SINGLE_USER_TOKEN=%s", sessionToken)} cmd.Stdout = os.Stdout - err := cmd.Run() + err = cmd.Run() if err != nil { log.Println("Failed to start server") log.Fatal(err)