topiary-io / topiary

a modern content management system
Other
2 stars 0 forks source link

Handle git actions and tell Hugo to rebuild after updating a file #9

Closed doesntgolf closed 8 years ago

doesntgolf commented 8 years ago

Every time a file is saved from the admin, we need to do a git add $file, git commit -m "update $file", hugo.

In itself this should be pretty simple, but eventually the git actions will need to be taken by the admin user. I think this means we'll have to pass a flag or two specifying the admin user's name and email, but I'm not entirely sure whether it'll be that simple.

To rebuild the file we should be able to just call the buildSite() func in the appropriate place in the save function. The git actions will also be in the save function (although maybe they should be in their own func?).

jbeane commented 8 years ago

Right now all page saves run "git add" and "git commit" - not ideal.

Side note: We should also create an overarching exec.command function to ensure we are handling args, errors, and other conditions properly across the board.