Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only write to file if content changed, fixes #794 #797

Merged
merged 3 commits into from
Jun 27, 2024

Conversation

a-h
Copy link
Owner

@a-h a-h commented Jun 16, 2024

No description provided.

@joerdav
Copy link
Collaborator

joerdav commented Jun 17, 2024

This will conflict with the org imports changes, I'll fix this up once org imports is merged

@@ -26,15 +26,16 @@ type Arguments struct {
func Run(log *slog.Logger, stdin io.Reader, stdout io.Writer, args Arguments) (err error) {
// If no files are provided, read from stdin and write to stdout.
if len(args.Files) == 0 {
return format(writeToWriter(stdout), readFromReader(stdin, args.StdinFilepath))
return format(writeToWriter(stdout), readFromReader(stdin, args.StdinFilepath), true)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't formatted properly.

@a-h a-h merged commit a0f5da5 into main Jun 27, 2024
6 checks passed
@a-h a-h deleted the issue_794_only_write_to_file_if_changed branch June 27, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants