summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-11-14 13:34:24 -0600
committerRuben Pollan <meskio@sindominio.net>2018-11-14 13:35:37 -0600
commit36c05e395e63837c27ed5d4eaf4377c7d5df1e76 (patch)
tree77380cbade5d37b2ed9d9816207f04a5d837844a
parent4dd33ac79ab139e2d70c8b70eaf8d0accc9bf22d (diff)
[feat] make autostart local paths absolute
-rw-r--r--standalone.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/standalone.go b/standalone.go
index 41b3c94..0808da6 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,