mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-06 18:24:57 +08:00
Don't fail when reading an empty file
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ func readYamlFile(filename string, path string, updateAll bool, docIndexInt int)
|
||||
|
||||
func handleEOF(updateAll bool, docIndexInt int, currentIndex int) error {
|
||||
log.Debugf("done %v / %v", currentIndex, docIndexInt)
|
||||
if !updateAll && currentIndex <= docIndexInt {
|
||||
if !updateAll && currentIndex <= docIndexInt && docIndexInt != 0 {
|
||||
return fmt.Errorf("Could not process document index %v as there are only %v document(s)", docIndex, currentIndex)
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user