Closed rkyoku closed 3 years ago
Both your approaches would work well.
gitsync
, that actually Flex Objects uses, too. This same idea could be used by the BlackHole plugin, however this is something the developer would have to implement in the plugin. I would open a ticket there and ask for it, it could be quite useful to trigger the sync after generate, 2 birds 1 stone.
Here is how Flex Objects does it for every CRUD task (https://github.com/trilbymedia/grav-plugin-flex-objects/blob/develop/classes/Controllers/ObjectController.php#L133)Hope this helps!
Thank you @w00fz for the idea!
I added your link to my feature request to BlackHole
, hoping they will give a positive response to it.
Meanwhile, I will probably use the Scheduler
that you kindly advised to me (that I didn't know about, I am 100% new to Grav
, I am not used to CMS in general, and Grav
in particular)
As for auto-sync everytime a custom folder is modified (can be helpful for the Flex Objects you talked about), I guess it is replaced by the cron job, then?
I did not find how to set "every five minutes" in the configuration page, but, well, "every 1 minute" would be fine too I guess :)
I let the contributors decide whether to close this feature request if they reckon the "Scheduler" is close enough to a "File Watch", it is fine by me!
Thanks again @w00fz !
Yes scheduler is the closest thing you can do since there isn't really a way to listen to folder changes in Grav/GitSync. A true file watch would require you to create the logic at the server level but at that point it would definitely be outside the Grav/GitSync scope.
Hi!
Is it possible for the plugin to auto-sync every time one of the (custom) folders was modified?
My current setup (new to Grav, please forgive any dumb question/setup):
generate
button inside plugin settingsuser/build
pages
andbuild
subfoldersBut it does not sync automatically.
I guess it would need some Node app with a file watcher plugin of some sort?
Do you reckon it is feasible, or maybe it would be easier to hook into the Blackhole plugin to trigger the sync? (or ask the Blackhole plugin to offer some setting to intertwine nicely with Git-Sync plugin?)
Worst case, I will hard-code this call myself in the Blackhole plugin, but it is not clean...
Thanks for any advice!
Best,