From 3955a70a265a7c68b809b84df841ffdd0bb72455 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Mon, 29 Jan 2024 22:39:05 +0000 Subject: [PATCH] Delete easily outdated template docs for `brew create` --- docs/Adding-Software-to-Homebrew.md | 27 ++------------------------- docs/Formula-Cookbook.md | 27 ++------------------------- 2 files changed, 4 insertions(+), 50 deletions(-) diff --git a/docs/Adding-Software-to-Homebrew.md b/docs/Adding-Software-to-Homebrew.md index 0bedc6eae3..d06e4dc090 100644 --- a/docs/Adding-Software-to-Homebrew.md +++ b/docs/Adding-Software-to-Homebrew.md @@ -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 diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md index db5aa895a2..17986b770b 100644 --- a/docs/Formula-Cookbook.md +++ b/docs/Formula-Cookbook.md @@ -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 --set-name `.