Skip to content

Commit a23bd53

Browse files
committed
Ensure the path is always trimmed
1 parent b0b3b31 commit a23bd53

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: systray/systray.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,27 @@ type Systray struct {
2525
// Restart restarts the program
2626
// it works by finding the executable path and launching it before quitting
2727
func (s *Systray) Restart() {
28+
29+
fmt.Println(s.path)
30+
fmt.Println(osext.Executable())
2831
if s.path == "" {
2932
var err error
3033
s.path, err = osext.Executable()
3134
if err != nil {
3235
fmt.Printf("Error getting exe path using osext lib. err: %v\n", err)
3336
}
34-
35-
// Trim newlines (needed on osx)
36-
s.path = strings.Trim(s.path, "\n")
3737
}
3838

39+
// Trim newlines (needed on osx)
40+
s.path = strings.Trim(s.path, "\n")
41+
3942
// Build args
4043
args := []string{"-ls", fmt.Sprintf("--hibernate=%v", s.Hibernate)}
4144

4245
if s.AdditionalConfig != "" {
4346
args = append(args, fmt.Sprintf("--additional-config=%s", s.AdditionalConfig))
4447
}
4548

46-
fmt.Println(s.path, args)
47-
4849
// Launch executable
4950
cmd := exec.Command(s.path, args...)
5051
err := cmd.Start()

0 commit comments

Comments
 (0)