diff options
Diffstat (limited to 'internal/service/service.go')
-rw-r--r-- | internal/service/service.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/service/service.go b/internal/service/service.go index 38cabf8..9fbacfb 100644 --- a/internal/service/service.go +++ b/internal/service/service.go @@ -10,9 +10,16 @@ import ( "sync" "time" + "git.server.ky/slackcoder/mirror/internal" "git.server.ky/slackcoder/mirror/internal/github" ) +// These commands are required by the service to operate. +var requiredCommands = []string{ + "git", + "rsync", +} + type Service struct { cfg *Config @@ -26,6 +33,12 @@ type Service struct { func NewService(cfg *Config) (*Service, error) { cfg.Apply(DefaultConfig) + for _, cmd := range requiredCommands { + if err := internal.RequireCommand(cmd); err != nil { + return nil, err + } + } + srv := &Service{ cfg: cfg, mirrors: nil, |