创建 brew 包

最后更新于:2022-04-02 03:45:27

[TOC] > [官网教程](https://docs.brew.sh/Formula-Cookbook) ## 初始化配置 ``` brew create https://github.com/idcpj/ferebook/releases/download/0.01/ferebook_mac_x86_64.tar.gz ``` 在 `/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ferebook.rb` 创建配置文件 ## 修改 xxx.rb
ferebook.rb ``` class Ferebook < Formula desc " download ferebook" homepage "" url "https://github.com/idcpj/ferebook/releases/download/0.01/ferebook_mac_x86_64.tar.gz" sha256 "20cf6c43c00ed7802447a6035f15f823ee62fd85011afcb838058d28fa4ebf1c" license "GPL-3.0" version "0.0.1" bottle :unneeded def install bin.install "ferebook" end end ```

## 创建个人仓库 1. 仓库名称必须以homebrew-anything格式来命名,如 homebrew-tap 2. 项目中创建 Formula目录, 3. 把上一步中创建的 ferebook.rb 加入Formula目录 4. 提交 ## 安装 ``` brew tap idcpj/tap brew install ferebook ```
';