1
0
Fork 0

Remove unused comments and rely on the Event{} from main.go to start

This commit is contained in:
Sebastian Schulze 2022-03-24 00:11:11 +01:00
parent df10b45f23
commit d458c05879
Signed by: bascht
GPG Key ID: 5BCB1D3B4D38A35A
1 changed files with 1 additions and 4 deletions

View File

@ -28,20 +28,17 @@ func Process(basedir string, document *Document) {
commands = append(commands, Command{Name: "cp", Args: []string{filepath.Join(basedir, "downloads", document.FullName()+".pdf"), "/mnt/himbeerkompott/home/bascht/Documents/Scans"}})
<- document.Events
document.Events <- Event{Message: "Geht los", Type: "info"}
for _, command := range commands {
// done := make(chan bool)
scanner := command.GetScanner()
command.Start()
go func() {
document.Events <- Event{Message: command.Name + " Startet mit " + strings.Join(command.Args, " "), Type: "info"}
document.Events <- Event{Message: "Starting with args " + strings.Join(command.Args, " "), Type: command.Name }
for scanner.Scan() {
document.Events <- Event{Message: scanner.Text(), Type: command.Name }
}
// done <- true
}()
command.Wait()
if command.cmd.ProcessState.ExitCode() != 0 {