Getting Started with Homebrew

unsplash photo

Homebrew is an Open Source Package Manager for macOS.

To create your first formula create a Repository on GitHub. Set the visibility to public while doing so.

First create a new GitHub Repository for your Formula. You can use the Web Interface or the CLI for this. I am using the CLI just for fun( Replace pwelagedara with your Username and hello with your repository name in all my commands).

Add the Ruby Script below and save it( CTRL + X and then y) to save).

Next make the file an executable. Push it to GitHub. Tag it and then push the Tag.

Under release tab in your GitHub Repository find the link to download *.tar.gz file of the release. Copy that link.

Now use the below commands to create the Formula. Make sure you know where the file got saved because you will need that for your Homebrew Tap( 3rd Party Repo).

In a new Directory create another Repository for the Tap. Remember that you need to prefix your Repository name with homebrew-.

Edit the file to look like below.

Now push the files to the GitHub Repository.

Now you can test it. If you have done everything right the last command will print “Hello…!!!”.

The Source Codes of the above Projects are available on my GitHub.

Photo Credits

unsplash-logoTyler Nix

You may also like

Leave a Reply

Your email address will not be published. Required fields are marked *