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

Watchmode txt files are not cleaned up #1045

Closed
joerdav opened this issue Jan 13, 2025 · 2 comments · Fixed by #1046
Closed

Watchmode txt files are not cleaned up #1045

joerdav opened this issue Jan 13, 2025 · 2 comments · Fixed by #1046

Comments

@joerdav
Copy link
Collaborator

joerdav commented Jan 13, 2025

Describe the bug
When running templ generate --watch and subsequently sending an interupt signal, the txt files which usually are removed still persist.

To Reproduce
In any templ project:

  • Run templ generate --watch
  • Observe txt files are created
  • Ctrl+C on the generate command
  • Observe txt files still exist

Expected behavior
txt files should be deleted.

templ info output

(✓) os [ goos=darwin goarch=arm64 ]
(✓) go [ location=/Users/josephdavidson/.asdf/shims/go version=go version go1.23.4 darwin/arm64 ]
(✓) gopls [ location=/Users/josephdavidson/.asdf/shims/gopls version=golang.org/x/tools/gopls v0.17.1 ]
(✓) templ [ location=/Users/josephdavidson/go/bin/templ version=v0.3.819 ]

Additional context
This was an issue introduced in this commit: 1f94c7b#diff-d871fda4ab49b4f5e6475e42ebccf5ca92261a30588f3d5165132dbe769587e1L188

@a-h
Copy link
Owner

a-h commented Jan 13, 2025

Yeah, that was silly of me...

@a-h a-h closed this as completed in #1046 Jan 13, 2025
@joerdav
Copy link
Collaborator Author

joerdav commented Jan 14, 2025

I think you were right to remove the function call, no need to trigger a generate again, I think the deletion of txt ended up being a side effect of that function so easily missed!

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 a pull request may close this issue.

2 participants