updated todo because i oofed
This commit is contained in:
@@ -92,7 +92,10 @@ func edit(dry bool, filepath string) error {
|
||||
return nil
|
||||
}
|
||||
verify := func() error {
|
||||
return dump(true, io.Discard, tempFile)
|
||||
if err := dump(true, io.Discard, tempFile); err != nil {
|
||||
return fmt.Errorf("failed to verify %s: %v", tempFile, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
save := func() error {
|
||||
if dry {
|
||||
@@ -104,12 +107,12 @@ func edit(dry bool, filepath string) error {
|
||||
|
||||
for _, foo := range []func() error{cp, vi, verify, save} {
|
||||
if err := foo(); err != nil {
|
||||
if tempFile != "" && !dry {
|
||||
os.Remove(tempFile)
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
if !dry {
|
||||
os.Remove(tempFile)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user