ampproject / amp-toolbox

A collection of AMP tools making it easier to publish and host AMP pages.
Apache License 2.0
449 stars 243 forks source link

[cli] Provide a command for downloading a specific AMP release #642

Closed sebastianbenz closed 4 years ago

sebastianbenz commented 4 years ago

Examples:

amp download --dest /dist
amp download --rtv=1234567 

Approach:

ithinkihaveacat commented 4 years ago

If you're very unlucky and start this process in the middle of a deployment, https://cdn.ampproject.org/files.txt might not match what's actually available on the server. (Or e.g. v0.js and amp-auto-lightbox-0.1.js might belong to different versions.)

To avoid this, perhaps downloading the "latest" release should actually first fetch https://cdn.ampproject.org/version.txt, and then download a specific version based on whatever it says is the latest.

mdmower commented 4 years ago

As a heads up, I've started work on this feature: https://github.com/mdmower/amp-toolbox/commits/pr-download

It works, but does not have documentation yet.