mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-06 10:04:43 +08:00
Fixed #1062
This commit is contained in:
@@ -44,8 +44,8 @@ func (w *writeInPlaceHandlerImpl) FinishWriteInPlace(evaluatedSuccessfully bool)
|
||||
safelyCloseFile(w.tempFile)
|
||||
if evaluatedSuccessfully {
|
||||
log.Debug("Moving temp file to target")
|
||||
safelyRenameFile(w.tempFile.Name(), w.inputFilename)
|
||||
tryRenameFile(w.tempFile.Name(), w.inputFilename)
|
||||
} else {
|
||||
tryRemoveFile(w.tempFile.Name())
|
||||
tryRemoveTempFile(w.tempFile.Name())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user