File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 4
4
"fmt"
5
5
"os"
6
6
"path/filepath"
7
+ "runtime"
7
8
"strings"
8
9
9
10
"github.com/kardianos/service"
@@ -37,15 +38,19 @@ func NewServiceWithDaemon(daemon service.Interface) (Service, error) {
37
38
exDirPath := filepath .Dir (ex )
38
39
executablePath := filepath .Join (exDirPath , "git-auto-sync-daemon" )
39
40
41
+ deps := []string {}
42
+ if runtime .GOOS == "linux" {
43
+ deps = []string {"After=network-online.target syslog.target" }
44
+ }
45
+
40
46
svcConfig := & service.Config {
41
47
Name : "git-auto-sync-daemon" ,
42
48
DisplayName : "Git Auto Sync Daemon" ,
43
49
Description : "Background Process for Auto Syncing Git Repos" ,
44
50
45
- Executable : executablePath ,
46
- Dependencies : []string {
47
- "After=network-online.target syslog.target" },
48
- Option : options ,
51
+ Executable : executablePath ,
52
+ Dependencies : deps ,
53
+ Option : options ,
49
54
}
50
55
51
56
s , err := service .New (daemon , svcConfig )
You can’t perform that action at this time.
0 commit comments