Get a list of created and updated files in extension

I’m currently maintaining the middleman-cloudfront extension which you can use when your website is fronted by Cloudfront and you want to invalidate files in Cloudfront on every deploy.
To figure out which files to invalidate (Cloudfront doesn’t allow you to use * or placeholders, so you need to specify each file explicitly) you can use a filter regex and the extension will look at all your files and invalidate only those that fit the filter.
Now somebody asked if it’s possible to only invalidate files that have actually changed (newly created or updated), which would absolutely make sense.

Is it possible to get the list of created and updated files in the after_build hook?

We would need to pass in the list of files here. When I add a parameter to the after_build block, it gets an instance of Middleman::Cli::Build which doesn’t seem to contain the list of built files unfortunately. (Correct?)

Any help would be appreciated! :smile:

@tdreyno Any idea? Would you accept a PR that implements this?

I just opened an issue regarding this topic: https://github.com/middleman/middleman/issues/1317