cask-pkg / cask.rs

A universal, distributed binary file manager. 一个通用的去中心化二进制管理器
MIT License
74 stars 3 forks source link

Support for fetching formula directly from the project repo #9

Closed iawia002 closed 2 years ago

iawia002 commented 2 years ago

close #4

I didn't use the method of determining if the repo exists first, since we are supporting two repo scenarios, there may be a repo in {package}-cask format but it is not used to store the Cask.toml file, this patch uses a simpler method and supports more scenarios, see my test results for https://github.com/iawia002/casktest-cask repo:

Fetching github.com/iawia002/casktest formula...
Downloading https://github.com/iawia002/lux/releases/download/v0.14.0/lux_0.14.0_macOS_64-bit.tar.gz
  [00:00:04] [###############################################################################################################################################################################################################] 13.79MiB/13.79MiB (3.41MiB/s, 0s)
The package 'github.com/iawia002/lux 0.14.0' has been installed!
Try run the command 'lux --help' to make sure it works!

Repo non-existent test:

Fetching github.com/iawia002/casktest1 formula...
It looks like the package does not support Cask
If you are the package owner, see our documentation for how to publish a package: https://github.com/axetroy/cask.rs/blob/main/DESIGN.md#how-do-i-publish-myothers-package
thread 'main' panicked at 'install package fail!: clone repository fail and exit code: 128

cc @axetroy I'll update the documentation if it's okay

axetroy commented 2 years ago

need to run the make format to format the rust code