Get rid of run() in favour of just wrapping it in Start()
This commit is contained in:
parent
f2c80f1a2d
commit
7b971eea37
2 changed files with 2 additions and 6 deletions
|
@ -13,11 +13,8 @@ type Command struct {
|
|||
cmd *exec.Cmd
|
||||
}
|
||||
|
||||
func (command *Command) run() {
|
||||
command.cmd = exec.Command(command.Name, command.Args...)
|
||||
}
|
||||
|
||||
func (command *Command) Start() {
|
||||
command.cmd = exec.Command(command.Name, command.Args...)
|
||||
command.cmd.Start()
|
||||
}
|
||||
|
||||
|
@ -26,7 +23,6 @@ func (command *Command) Wait() {
|
|||
}
|
||||
|
||||
func (command *Command) NewScanner() *bufio.Scanner {
|
||||
command.run()
|
||||
|
||||
stderr, err := command.cmd.StderrPipe()
|
||||
if err != nil {
|
||||
|
|
|
@ -30,6 +30,7 @@ func Process(basedir string, document *Document) string {
|
|||
|
||||
for _, command := range commands {
|
||||
done := make(chan bool)
|
||||
command.Start()
|
||||
go func() {
|
||||
document.Events <- command.Name + " Startet"
|
||||
|
||||
|
@ -41,7 +42,6 @@ func Process(basedir string, document *Document) string {
|
|||
document.Events <- command.Name + " Ist fast fertig"
|
||||
done <- true
|
||||
}()
|
||||
command.Start()
|
||||
document.Events <- command.Name + " Ist gestartet"
|
||||
command.Wait()
|
||||
<-done
|
||||
|
|
Loading…
Reference in a new issue