Merge pull request #16 from pblaszczyk/exit_code
In case of error, exit status should be different than 0.
This commit is contained in:
commit
4bf44a02f1
11
main.go
11
main.go
|
@ -40,7 +40,7 @@ func main() {
|
||||||
fs, err := os.Open(in)
|
fs, err := os.Open(in)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "[e] %s\n", err)
|
fmt.Fprintf(os.Stderr, "[e] %s\n", err)
|
||||||
return
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer fs.Close()
|
defer fs.Close()
|
||||||
|
@ -48,7 +48,7 @@ func main() {
|
||||||
fd, err := os.Create(*out)
|
fd, err := os.Create(*out)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "[e] %s\n", err)
|
fmt.Fprintf(os.Stderr, "[e] %s\n", err)
|
||||||
return
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer fd.Close()
|
defer fd.Close()
|
||||||
|
@ -68,7 +68,7 @@ func main() {
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "[e] %s\n", err)
|
fmt.Fprintf(os.Stderr, "[e] %s\n", err)
|
||||||
return
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
bindata.WriteTOCInit(fd, in, *prefix, *funcname)
|
bindata.WriteTOCInit(fd, in, *prefix, *funcname)
|
||||||
|
@ -91,10 +91,7 @@ func parseArgs() {
|
||||||
pipe = flag.NArg() == 0
|
pipe = flag.NArg() == 0
|
||||||
|
|
||||||
if !pipe {
|
if !pipe {
|
||||||
sepsuffix := false
|
sepsuffix := strings.HasSuffix(*prefix, string(filepath.Separator))
|
||||||
if strings.HasSuffix(*prefix, string(filepath.Separator)) {
|
|
||||||
sepsuffix = true
|
|
||||||
}
|
|
||||||
*prefix, _ = filepath.Abs(filepath.Clean(*prefix))
|
*prefix, _ = filepath.Abs(filepath.Clean(*prefix))
|
||||||
if sepsuffix {
|
if sepsuffix {
|
||||||
*prefix += string(filepath.Separator)
|
*prefix += string(filepath.Separator)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user