Pass along inherited environemnt variables

This commit is contained in:
Neale Pickett 2016-05-18 23:02:23 +00:00
parent cfe75df50f
commit e9ccb68622
2 changed files with 8 additions and 8 deletions

View File

@ -191,14 +191,13 @@ func (nw *Network) messageDispatchLoop() {
handlerPath := path.Join(nw.basePath, "handler") handlerPath := path.Join(nw.basePath, "handler")
cmd := exec.Command(handlerPath, m.Args...) cmd := exec.Command(handlerPath, m.Args...)
cmd.Env = []string{ cmd.Env = os.Environ()
"command=" + m.Command, cmd.Env = append(cmd.Env, "command=" + m.Command)
"fullsender=" + m.FullSender, cmd.Env = append(cmd.Env, "fullsender=" + m.FullSender)
"sender=" + m.Sender, cmd.Env = append(cmd.Env, "sender=" + m.Sender)
"forum=" + m.Forum, cmd.Env = append(cmd.Env, "forum=" + m.Forum)
"text=" + m.Text, cmd.Env = append(cmd.Env, "text=" + m.Text)
"raw=" + line, cmd.Env = append(cmd.Env, "raw=" + line)
}
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
out, err := cmd.Output() out, err := cmd.Output()
if err != nil { if err != nil {

View File

@ -104,4 +104,5 @@ func main() {
runsvdir(basePath) runsvdir(basePath)
running = false running = false
log.Print("Exiting for some reason!")
} }