cake-build/cake

Feature request: built-in scheme for #tool to download an arbitrary HTTPS .zip file

Open

#2,731 创建于 2020年3月12日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)C# (3,742 star) (738 fork)batch import
Help wantedUp-for-grabs

描述

Parameters

  • Version parameter: no. There would be no notion of the downloaded tool having a version, so no version or prerelease parameters.

  • Format parameter: maybe The format could be autodetected from the content type or file contents in case you eventually support archive formats other than .zip. There probably wouldn't be a need for a type/format parameter but it might be desirable.

  • Checksum parameter: I want this. Even if the download is over HTTPS, it's nice to know if something else starts getting served. This would make HTTP/FTP URLs safe too. If the checksum is missing, Cake could download the file and then include the checksum in an error message requiring the checksum to be present in the .cake file.

Since query parameters in the same URL would collide with the URL to use for the download whether or not they are excluded when downloading, there would need to be a new way to handle this.

Proposal

#tool download: followed by a URL. If the URL contains a comma, it must be URL-encoded.

A parameter may be specified no more than once. Some parameters are required. To specify a parameter, add a comma to the end of the line followed by the parameter name, an equals sign, and a parameter value. If the parameter value contains a double quote character or comma, the whole parameter value must be double-quoted.

Valid parameter names:

  • checksum: Required. Value must start with SHA256: and the remainder must be 32 hex characters, case-insensitive. Future checksums may be supported.
#tool download:http://static.wixtoolset.org/releases/v3.14.0.3910/wix314-binaries.zip, checksum=SHA256:0904A88A4BCD9DD3C2274CAABE73989CD72767EE90C8FA0BF813D004EEC90D32

Questions

  1. Is a format parameter desirable even if multiple formats become supported?

  2. Should there be support for the file scheme or absolute or relative or Windows UNC paths?

  3. Should checksum be allowed to be omitted for HTTPS downloads? What about HTTP/FTP/file schemes?

贡献者指南