Rename sitemap after script execution

Hi everyone, we have 3 sitemaps we want to generate daily. Products, categories, and brands, however one issue I’m running into is that by default it names the output sitemap0.xml. However, each needs to be named specifically like “sitemap-products.xml” etc. Each sitemap is generated separately using the below article. As far as I can tell the algolia-sitemap library handles the naming. Any idea on how to change the output?

Thank you

Hey @adeakman!

The sitemap code is in a public repo. Here’s the code that writes the individual files:

You could modify this to allow you to pass in a filename other than sitemap or just wrap the whole execution in a script that generates each sitemap and then renames it.