cedaro / satispress

Expose installed WordPress plugins and themes as Composer packages.
500 stars 48 forks source link

Question: easiest way to get latstest stable release from specific package. #169

Closed Levdbas closed 2 years ago

Levdbas commented 2 years ago

Hi and thank you a ton for this awesome plugin,

I currently have a rest endpoint that reports the latest version of a theme in the themes directory. I use this endpoint to report to my themes settings page the latest version available. Since I am currently testing Beta's as well this no longer works since I would only like to report the latest stable release of a specific package. Can you point me in the right direction on which class/method to use to achieve this for a specific package?

bradyvercher commented 2 years ago

@Levdbas I'm not sure how you're grabbing the latest version at the moment, so can't make any specific recommendations there. SatisPress doesn't determine stability or do anything differently for non-stable releases. That's managed by Composer and depends on the version suffix.

If you haven't solved this already, I'd recommend looping through the theme releases and checking the version string for one of the keywords that Composer uses and fallback to the previous version if it exists.