From 36c05e395e63837c27ed5d4eaf4377c7d5df1e76 Mon Sep 17 00:00:00 2001 From: Ruben Pollan <meskio@sindominio.net> Date: Wed, 14 Nov 2018 13:34:24 -0600 Subject: [PATCH] [feat] make autostart local paths absolute --- standalone.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/standalone.go b/standalone.go index 41b3c942..0808da67 100644 --- a/standalone.go +++ b/standalone.go @@ -21,6 +21,7 @@ import ( "fmt" "log" "os" + "path/filepath" "regexp" "0xacab.org/leap/bitmask-systray/bitmask" @@ -54,6 +55,13 @@ func newAutostart(appName string, iconPath string) autostart { } } + if exec[0][:2] == "./" || exec[0][:2] == ".\\" { + var err error + exec[0], err = filepath.Abs(exec[0]) + if err != nil { + log.Printf("Error making the path absolute directory: %v", err) + } + } return &pmautostart.App{ Name: appName, -- GitLab