diff --git a/Formula/README.md b/Formula/README.md new file mode 100644 index 0000000..c58776e --- /dev/null +++ b/Formula/README.md @@ -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. diff --git a/Formula/litcli.rb b/Formula/litcli.rb new file mode 100644 index 0000000..dfeb104 --- /dev/null +++ b/Formula/litcli.rb @@ -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 \ No newline at end of file diff --git a/cmd/lit/main.go.md b/cmd/lit/main.go.md index 247ee12..91aef26 100644 --- a/cmd/lit/main.go.md +++ b/cmd/lit/main.go.md @@ -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