Non-zero exit status if something failed
This commit is contained in:
		
							
								
								
									
										4
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								main.go
									
									
									
									
									
								
							@@ -193,4 +193,8 @@ func main() {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		log.Fatalln(err)
 | 
							log.Fatalln(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if somethingFailed {
 | 
				
			||||||
 | 
							os.Exit(1)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								pew.go
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								pew.go
									
									
									
									
									
								
							@@ -24,6 +24,8 @@ import (
 | 
				
			|||||||
	qemu "github.com/jollheef/out-of-tree/qemu"
 | 
						qemu "github.com/jollheef/out-of-tree/qemu"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var somethingFailed = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func dockerCommand(container, workdir, timeout, command string) *exec.Cmd {
 | 
					func dockerCommand(container, workdir, timeout, command string) *exec.Cmd {
 | 
				
			||||||
	return exec.Command("timeout", "-k", timeout, timeout, "docker", "run",
 | 
						return exec.Command("timeout", "-k", timeout, timeout, "docker", "run",
 | 
				
			||||||
		"-v", workdir+":/work", container,
 | 
							"-v", workdir+":/work", container,
 | 
				
			||||||
@@ -116,6 +118,7 @@ func genOkFail(name string, ok bool) aurora.Value {
 | 
				
			|||||||
		s := " " + name + " SUCCESS "
 | 
							s := " " + name + " SUCCESS "
 | 
				
			||||||
		return aurora.BgGreen(aurora.Black(s))
 | 
							return aurora.BgGreen(aurora.Black(s))
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
 | 
							somethingFailed = true
 | 
				
			||||||
		s := " " + name + " FAILURE "
 | 
							s := " " + name + " FAILURE "
 | 
				
			||||||
		return aurora.BgRed(aurora.Gray(aurora.Bold(s)))
 | 
							return aurora.BgRed(aurora.Gray(aurora.Bold(s)))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user