Handle clang-format's stderr more nicely.

This commit is contained in:
Nigel Tao committed 2017-05-26 11:23:19 +10:00
1 parent ddba103284
commit 7e18d9b549
2 files changed
+11 -13

No files matched your search

+4 -1
View File
@@ -8,6 +8,7 @@ import (
"flag"
"io/ioutil"
"os"
"os/exec"
"github.com/google/puffs/lang/ast"
"github.com/google/puffs/lang/check"
@@ -28,7 +29,9 @@ type Generator interface {
func Main(g Generator) {
if err := main1(g); err != nil {
os.Stderr.WriteString(err.Error() + "\n")
if _, ok := err.(*exec.ExitError); !ok {
os.Stderr.WriteString(err.Error() + "\n")
}
os.Exit(1)
}
}