WIP creates valid userspace plist on os x

This commit is contained in:
AJ ONeal 2019-06-27 03:14:16 -06:00
parent ae809d5d5e
commit fb4f0c5a69
3 changed files with 8 additions and 2 deletions

View File

@ -9,15 +9,15 @@
{{- if .Interpreter }}
<string>{{ .Interpreter }}</string>
{{- end }}
<string>{{ .Exec }}</string>
<string>{{ .Local }}/opt/{{ .Name }}/{{ .Exec }}</string>
{{- if .Argv }}
{{- range $arg := .Argv }}
<string>{{ $arg }}</string>
{{- end }}
{{- end }}
</array>
<key>EnvironmentVariables</key>
{{- if .Envs }}
<key>EnvironmentVariables</key>
<dict>
{{- range $key, $value := .Envs }}
<key>{{ $key }}</key>

View File

@ -59,5 +59,10 @@ func Install(c *Config) error {
return err
}
err = os.MkdirAll(c.LogDir, 0750)
if nil != err {
return err
}
return nil
}

View File

@ -21,6 +21,7 @@ func usage() {
}
func main() {
fmt.Println("Watchdog " + GitVersion)
for i := range os.Args {
switch {
case strings.HasSuffix(os.Args[i], "version"):