From b21191c578194ba119d369d8d28fb574e53bbce7 Mon Sep 17 00:00:00 2001 From: ziprandom Date: Thu, 1 Apr 2021 10:14:49 +0000 Subject: [PATCH] linux: find server executable relative to app this enables having config.json in a different dir than the executables --- linux/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linux/main.go b/linux/main.go index cdabdca37..4c6ef9ad5 100644 --- a/linux/main.go +++ b/linux/main.go @@ -6,6 +6,7 @@ import ( "log" "os" "os/exec" + "path/filepath" "strconv" "github.com/google/uuid" @@ -13,9 +14,10 @@ import ( ) var sessionToken string = "su-" + uuid.New().String() +var serverExecutable string = filepath.Join(filepath.Dir(os.Executable()), "focalboard-server") func runServer(ctx context.Context) { - cmd := exec.CommandContext(ctx, "./focalboard-server", "--monitorpid", strconv.FormatInt(int64(os.Getpid()), 10), "-single-user") + 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()