mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Delete easily outdated template docs for brew create
This commit is contained in:
parent
3f5ae06ab1
commit
3955a70a26
@ -165,36 +165,13 @@ If the `generate_cask_token` script does not work for you, see [Cask Token Detai
|
||||
|
||||
#### Creating the cask file
|
||||
|
||||
Once you know the token, create your cask with the handy-dandy `brew create --cask` command:
|
||||
Once you know the token, create your cask with the `brew create --cask` command:
|
||||
|
||||
```bash
|
||||
brew create --cask download-url --set-name my-new-cask
|
||||
```
|
||||
|
||||
This will open `EDITOR` with a template for your new cask, to be stored in the file `my-new-cask.rb`. Running the `create` command above will get you a template that looks like this:
|
||||
|
||||
```ruby
|
||||
cask "my-new-cask" do
|
||||
version "fill in the version here"
|
||||
sha256 "fill in the sha256 here"
|
||||
|
||||
url "download-url"
|
||||
name "fill in the name"
|
||||
desc "Fill in the description here"
|
||||
homepage "fill in the homepage here"
|
||||
|
||||
livecheck do
|
||||
url ""
|
||||
strategy ""
|
||||
end
|
||||
|
||||
depends_on macos: ""
|
||||
|
||||
app ""
|
||||
|
||||
zap trash: ""
|
||||
end
|
||||
```
|
||||
This will open `EDITOR` with a template for your new cask, to be stored in the file `my-new-cask.rb`.
|
||||
|
||||
#### Cask stanzas
|
||||
|
||||
|
@ -60,33 +60,10 @@ Run `brew create` with a URL to the source tarball:
|
||||
brew create https://example.com/foo-0.1.tar.gz
|
||||
```
|
||||
|
||||
This creates `$(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula/f/foo.rb` and opens it in your `EDITOR`.
|
||||
|
||||
Passing in `--ruby` or `--python` will populate various defaults commonly useful for projects written in those languages.
|
||||
|
||||
This creates `$(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula/f/foo.rb` and opens it in your `EDITOR`. If run without any options to customize the output for specific build systems (check `brew create --help` to see which are available) it'll look something like:
|
||||
|
||||
```ruby
|
||||
class Foo < Formula
|
||||
desc "Fill in a one-line description of your formula"
|
||||
homepage "https://your.homepage/"
|
||||
url "https://example.com/foo-0.1.tar.gz"
|
||||
sha256 "85cc828a96735bdafcf29eb6291ca91bac846579bcef7308536e0c875d6c81d7"
|
||||
license "Fill in a license identifier"
|
||||
|
||||
# depends_on "cmake" => :build
|
||||
|
||||
def install
|
||||
# ENV.deparallelize
|
||||
system "./configure", *std_configure_args, "--disable-silent-rules"
|
||||
# system "cmake", "-S", ".", "-B", "build", *std_cmake_args
|
||||
system "make", "install"
|
||||
end
|
||||
|
||||
test do
|
||||
system "false"
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
If `brew` said `Warning: Version cannot be determined from URL` when doing the `create` step, you’ll need to explicitly add the correct [`version`](https://rubydoc.brew.sh/Formula#version-class_method) to the formula and then save the formula.
|
||||
|
||||
Homebrew will try to guess the formula’s name from its URL. If it fails to do so you can override this with `brew create <URL> --set-name <name>`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user