File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 44 "fmt"
55 "os"
66 "path/filepath"
7+ "runtime"
78 "strings"
89
910 "github.com/kardianos/service"
@@ -37,15 +38,19 @@ func NewServiceWithDaemon(daemon service.Interface) (Service, error) {
3738 exDirPath := filepath .Dir (ex )
3839 executablePath := filepath .Join (exDirPath , "git-auto-sync-daemon" )
3940
41+ deps := []string {}
42+ if runtime .GOOS == "linux" {
43+ deps = []string {"After=network-online.target syslog.target" }
44+ }
45+
4046 svcConfig := & service.Config {
4147 Name : "git-auto-sync-daemon" ,
4248 DisplayName : "Git Auto Sync Daemon" ,
4349 Description : "Background Process for Auto Syncing Git Repos" ,
4450
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 ,
4954 }
5055
5156 s , err := service .New (daemon , svcConfig )
You can’t perform that action at this time.
0 commit comments