github.com/mem/u-root@v2.0.1-0.20181004165302-9b18b4636a33+incompatible/pkg/sh/run.go (about) 1 // Copyright 2018 the u-root Authors. All rights reserved 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package sh 6 7 import ( 8 "log" 9 "os" 10 "os/exec" 11 ) 12 13 func RunOrDie(arg0 string, args ...string) { 14 cmd := exec.Command(arg0, args...) 15 cmd.Stdin = os.Stdin 16 cmd.Stdout = os.Stdout 17 cmd.Stderr = os.Stderr 18 if err := cmd.Run(); err != nil { 19 log.Fatal(err) 20 } 21 }