statamic / spock

Automatically perform git commits, pushes, and other cli actions when Statamic content changes
95 stars 16 forks source link

Spock missing some events? #41

Closed bluetidepro closed 5 years ago

bluetidepro commented 5 years ago

I was looking at SpockListener.php and it seems like it is missing some files from the \Statamic\Events\Data\ folder.

For example, Spock has PageSaved, PageDeleted, and PagesMoved, but is missing stuff like PagesReordered, PageMoved.

Is it safe to just add everything from \Statamic\Events\Data\ into the public $events array in SpockListener.php? Or is there reasons some of those events are not included? Are they maybe bugged on some of them?

jesseleite commented 5 years ago

Heyo!

PagesReordered is not a Spock-compatible DataEvent (see line 59 here).

Also, Spock shouldn't be listening to both PageMoved and PagesMoved, since they would be submitting the same paths through git more than once.

There's room for improvement, but we're mostly focusing on v3 at this point. Spock will definitely be updated as we make improvements on that end ☺️

Anyway, closing this issue for now, but feel free to re-open with more details if this is causing you problems!