BUT.. I don't know that things are in the right/best place. A self-contained additional class could work here. Anyway, consider this the first pass at an idea. ;)
(Miscellaneous: I added a .editorconfig to preserve your preference for tabs instead of spaces, and added .hotreload to .gitignore)
This works and cleans itself up afterwards, etc.
BUT.. I don't know that things are in the right/best place. A self-contained additional class could work here. Anyway, consider this the first pass at an idea. ;)
(Miscellaneous: I added a .editorconfig to preserve your preference for tabs instead of spaces, and added .hotreload to .gitignore)