In case of error, exit status should be different than 0.

pull/4/head
Paweł Błaszczyk 2014-01-07 17:41:09 +01:00
parent 37aa0dc02e
commit 85c2b05609
1 changed files with 4 additions and 7 deletions

11
main.go
View File

@ -40,7 +40,7 @@ func main() {
fs, err := os.Open(in)
if err != nil {
fmt.Fprintf(os.Stderr, "[e] %s\n", err)
return
os.Exit(1)
}
defer fs.Close()
@ -48,7 +48,7 @@ func main() {
fd, err := os.Create(*out)
if err != nil {
fmt.Fprintf(os.Stderr, "[e] %s\n", err)
return
os.Exit(1)
}
defer fd.Close()
@ -68,7 +68,7 @@ func main() {
if err != nil {
fmt.Fprintf(os.Stderr, "[e] %s\n", err)
return
os.Exit(1)
}
bindata.WriteTOCInit(fd, in, *prefix, *funcname)
@ -91,10 +91,7 @@ func parseArgs() {
pipe = flag.NArg() == 0
if !pipe {
sepsuffix := false
if strings.HasSuffix(*prefix, string(filepath.Separator)) {
sepsuffix = true
}
sepsuffix := strings.HasSuffix(*prefix, string(filepath.Separator))
*prefix, _ = filepath.Abs(filepath.Clean(*prefix))
if sepsuffix {
*prefix += string(filepath.Separator)