better error message if directory is not found

This commit is contained in:
Chris Lu 2013-07-13 22:01:48 -07:00
parent 76ba0021e5
commit ddf4f27a56

View File

@ -125,13 +125,17 @@ func runUpload(cmd *Command, args []string) bool {
return false
}
filepath.Walk(*uploadDir, func(path string, info os.FileInfo, err error) error {
if !info.IsDir() {
results, e := submit([]string{path})
bytes, _ := json.Marshal(results)
fmt.Println(string(bytes))
if e != nil {
return e
if err == nil {
if !info.IsDir() {
results, e := submit([]string{path})
bytes, _ := json.Marshal(results)
fmt.Println(string(bytes))
if e != nil {
return e
}
}
} else {
fmt.Println(err)
}
return err
})