Flaque / thaum

Thaum is a simple boilerplate and scaffolding command line utility.
https://flaque.github.io/thaum/
MIT License
23 stars 3 forks source link

Create an "Undo" feature #1

Open Flaque opened 7 years ago

Flaque commented 7 years ago

If users enter in the wrong template or they use the command in the wrong place, it may be nice to have an "undo" command by typing:

$ thaum -u

This could be implemented by writing to a temporary file. (afero) has a function for this. In that file, you could store a checksum and the path of each file that you created.

Then, when the user calls thaum -u, you check to see if there is a temporary file and you match the checksums of each file against the ones stored. That way we don't remove files that people have edited.