跳转到内容

cnb-rs download archive

cnb-rs download archive [REF] [options]

下载仓库 archive(zip 打包),可限定到子路径。

选项

  • [REF]: Git ref(分支 / tag / commit,默认 HEAD 即仓库默认分支)
  • -p, --path <PATH>: 限制到子路径(如 src/docs/badge.md
  • -o, --output <FILE>: 保存路径(默认 <repo-tail>-<ref-short>.zip 写当前目录)

继承的全局选项:

  • --repo <REPO>: 指定仓库路径
  • --domain <DOMAIN>: 指定目标域名

示例

bash
# 默认:下载默认分支整仓 zip 到当前目录
$ cnb-rs download archive
 已下载 archive cnb-rs-HEAD.zip (601.8 KB)

# 指定分支 / tag
$ cnb-rs download archive main -o /tmp/snapshot.zip
$ cnb-rs download archive v0.12.0

# 仅打包某子路径
$ cnb-rs download archive HEAD -p src/ -o src-only.zip

# 输出到目录(保留默认文件名)
$ cnb-rs download archive HEAD -o ./builds/
 已下载 archive builds/cnb-rs-HEAD.zip (601.8 KB)

另请参阅

Released under the MIT License.