Skip to content

Create homebrew formula #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions Formula/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
homebrew-lit
============
Homebrew formulae for installing lit cli tool on MacOS.

# Usage

## Homebrew-project
The following requires that a special project be setup on Github to house your brew formulas. This is not currently available but has been provided as information for future expansion. Please refer to the [Direct URL Installation Method](#Direct-URL-Installation) below.

Use the following commands to Tap the Homebrew repository:

```sh
brew tap literate-programming/lit
```

Then install the `lit-cli` formula

```sh
brew install lit-cli
```

## Direct URL Installation
Until a specific Homebrew project is setup to house the formula you need to install directly from the URL as follows:
```
brew install https://raw.githubusercontent.com/literate-programming/lit/master/Formula/lit-cli.rb

```

# Testing changes
The following process can be used to test changes made to formula:
1. Ensure the target formula has already been installed on your system. I will use `lit-cli` to demonstrate.
2. Fork this repo on Github and clone it locally to your machine.
3. Create a new branch for your changes.
4. Make your changes to the target formula and commit them.
5. Change directory into the `Formula` foldere
```sh
cd $(brew --repo literate-programming/lit)/Formula
```
6. Unlink the currently installed version of the formula with the following command:
```sh
brew unlink lit-cli
```
6. Copy your updated formula into the `literate-programming/lit/Formula` folder - replacing the exiting version
7. Test download of the new package from the Formula URL
```sh
brew fetch lit-cli
```
8. Test the installation using the new Formula (with verbose mode and based on the locally updated file)
```sh
brew install -vsd --git lit-cli
```

All going well, you should have just installed the updated version based on the new formula. If that is the case, submit a PR with your changes for further review. If you encounter issue, repeat the process above until you are able to successfully install the based on the udpated version.
36 changes: 36 additions & 0 deletions Formula/litcli.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# MIT License
#
# Copyright (c) 2019 BigOokie
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

class Litcli < Formula
desc "The universal literate programming tool"
homepage "https://github.com/literate-programming/lit"
url "https://github.com/literate-programming/lit/releases/download/v0.3.1/lit_darwin_386"
version "0.3.1"
sha256 "64c61ab23148b3f96260ed725dfbe4dba4eeafa14d9edd65e52eb6ce8d6e970b"

bottle :unneeded

def install
mv "lit_darwin_386", "lit"
bin.install "lit"
end
end
2 changes: 1 addition & 1 deletion cmd/lit/main.go.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

the cli is really lightweight and small in implementation.

at first we check if the first arg is `version`. if it ism then print the version of the tool to `stdout`
at first we check if the first arg is `version`. If it is then print the version of the tool to `stdout`

package main

Expand Down