Skip to content

Commit

Permalink
chore: Include file paths and error text in copy fallback logic
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Sep 24, 2024
1 parent 98ddad0 commit a01896e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ func openAndTemplateFile(conf *config.Config, w io.Writer, path string) error {
}

if err := os.Rename(temp.Name(), path); err != nil {
slog.Debug("Failed to rename file. Attempting to copy contents.")
slog.Debug("Failed to rename file. Attempting to copy contents.",
"from", temp.Name(),
"to", path,
"error", err,
)

out, err := os.OpenFile(path, os.O_WRONLY|os.O_TRUNC, stat.Mode())
if err != nil {
Expand Down

0 comments on commit a01896e

Please sign in to comment.