statamic / spock

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

Simplify and listen to more data/content related events #13

Closed jesseleite closed 6 years ago

jesseleite commented 6 years ago

Goal

The goal of this PR is to get Spock to listen to more /cp events. Not concerned with changes made via Workshop at this point, but might be worth looking into after this is released.

Prerequisites

Content Section

Configure Section (maybe? look into if easy enough)

How to test

Prerelease

If you intend to run Spock on a version of statamic older than , please use Spock version .

jesseleite commented 6 years ago

Note:

Listen on delete asset with meta data

That one works, but commits twice. Once for AssetDeleted and another time for AssetContainerSaved. I'm thinking we could clean this up by removing AssetContainerSaved from Spock's listeners array, and add the container path to AssetDeleted's affected paths. If we do this, we'd need to also do this for editing asset meta data though.

Thoughts?

jasonvarga commented 6 years ago

If we don't listen for asset container mods, you won't be able to track editing the container itself. (eg. /cp/configure/content/assets/main)

🤔

jasonvarga commented 6 years ago

Merged into the v2 branch. 👍