Update dependencies (#333)

This commit is contained in:
tobi 2021-11-27 15:26:58 +01:00 committed by GitHub
commit 182b4eea73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
848 changed files with 377869 additions and 107280 deletions

View file

@ -375,7 +375,7 @@ func Shell(cmd string, args ...string) ([]byte, error) {
func MustShell(stackTrace bool, cmd string, args ...string) []byte {
b, err := Shell(cmd, args...)
if err != nil {
Fatalf(stackTrace, "%s\n%s", b, err)
Fatalf(stackTrace, "%v %s\noutput: %s\nerr: %s", cmd, args, b, err)
}
return b
@ -389,6 +389,26 @@ func MustCompile(stackTrace bool, args ...string) []byte {
return MustShell(stackTrace, "ccgo", args...)
}
// Run is like Compile, but executes in-process.
func Run(args ...string) ([]byte, error) {
var b bytes.Buffer
t := NewTask(append([]string{"ccgo"}, args...), &b, &b)
err := t.Main()
return b.Bytes(), err
}
// MustRun is like Run but if executes Fatal(stackTrace, err) if it fails.
func MustRun(stackTrace bool, args ...string) []byte {
var b bytes.Buffer
args = append([]string{"ccgo"}, args...)
t := NewTask(args, &b, &b)
if err := t.Main(); err != nil {
Fatalf(stackTrace, "%v\noutput: %s\nerr: %s", args, b.Bytes(), err)
}
return b.Bytes()
}
// AbsCwd returns the absolute working directory.
func AbsCwd() (string, error) {
wd, err := os.Getwd()