Closed J7mbo closed 4 years ago
It seems that body.html~
is a backup file. Delete it and try again.
rm /Users/jimbo/Documents/Dev/app/internal/public/html/body.html~
Gives:
rm: /Users/jimbo/Documents/Dev/app/internal/public/html/body.html~: No such file or directory
The file doesn't exist for me to delete it.
I solved this. My IDE is generating temporary files. This is also a MacOS thing.
In order to use this tool, I have to go into my IntelliJ IDE (in my case, Jetbrains) and disable "Use 'safe write' (save changes to a temporary file first)".
The problem is, I want safe write and shouldn't have to disable it to use this library as I don't have this problem with other file watchers :).
Can there be a solution where all files with a Tilda (~) at the end are ignored?
I don’t think Go has a mature enough ecosystem to support templating like this. Closing for now and using a better tool for the job.
The following command works:
hero -source="./internal/public/html" -dest="./internal/template/"
As soon as I append
watch
on the end, it waits for a change in the html file as expected.However, when I make a change and then save the html file, I get the following:
2020/02/19 21:56:21 stat /Users/jimbo/Documents/Dev/app/internal/public/html/body.html~: no such file or directory
...and it crashes.