From 5a37b4cebb5965abf015aaf3092f78f0e29a39c8 Mon Sep 17 00:00:00 2001 From: BigOokie <36015380+BigOokie@users.noreply.github.com> Date: Mon, 21 Oct 2019 09:46:05 +1100 Subject: [PATCH 1/9] Correct minor typo in file --- cmd/lit/main.go.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 00926ec54352a81062a79c0bd09e5ded2eadf0e6 Mon Sep 17 00:00:00 2001 From: BigOokie <36015380+BigOokie@users.noreply.github.com> Date: Mon, 21 Oct 2019 18:45:11 +1100 Subject: [PATCH 2/9] Initial addition of homebrew formula for lit cli tool --- Formula/lit-cli.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Formula/lit-cli.rb diff --git a/Formula/lit-cli.rb b/Formula/lit-cli.rb new file mode 100644 index 0000000..203c8cf --- /dev/null +++ b/Formula/lit-cli.rb @@ -0,0 +1,35 @@ +# 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 lit-cli < 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 + bin.install "lit-cli" + end +end \ No newline at end of file From c2b75c3dab583e7893dd0acb7cf738e21d119287 Mon Sep 17 00:00:00 2001 From: BigOokie <36015380+BigOokie@users.noreply.github.com> Date: Mon, 21 Oct 2019 18:53:56 +1100 Subject: [PATCH 3/9] Add Readme to Formula folder describing the process for testing changes --- Formula/README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Formula/README.md diff --git a/Formula/README.md b/Formula/README.md new file mode 100644 index 0000000..923e98f --- /dev/null +++ b/Formula/README.md @@ -0,0 +1,43 @@ +homebrew-lit +============ +Homebrew formulae for installing lit cli tool on MacOS. + +# Usage + +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 +``` + +# 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. From c4cec2a44a1dc7c06a091538df4ea8c751f6331f Mon Sep 17 00:00:00 2001 From: BigOokie <36015380+BigOokie@users.noreply.github.com> Date: Mon, 21 Oct 2019 19:08:02 +1100 Subject: [PATCH 4/9] Updates following testing --- Formula/README.md | 12 +++++++++++- Formula/lit-cli.rb | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Formula/README.md b/Formula/README.md index 923e98f..c58776e 100644 --- a/Formula/README.md +++ b/Formula/README.md @@ -4,7 +4,10 @@ Homebrew formulae for installing lit cli tool on MacOS. # Usage -Use the following commands to Tap the Homebrew repository +## 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 @@ -16,6 +19,13 @@ Then install the `lit-cli` formula 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. diff --git a/Formula/lit-cli.rb b/Formula/lit-cli.rb index 203c8cf..e6a957f 100644 --- a/Formula/lit-cli.rb +++ b/Formula/lit-cli.rb @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -class lit-cli < Formula +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" From fd36cb044008ac316ebdd9a29fa6e71daf272e68 Mon Sep 17 00:00:00 2001 From: BigOokie <36015380+BigOokie@users.noreply.github.com> Date: Mon, 21 Oct 2019 19:08:48 +1100 Subject: [PATCH 5/9] Rename file following initial testing --- Formula/{lit-cli.rb => litcli.rb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Formula/{lit-cli.rb => litcli.rb} (100%) diff --git a/Formula/lit-cli.rb b/Formula/litcli.rb similarity index 100% rename from Formula/lit-cli.rb rename to Formula/litcli.rb From beefc5ccc3abe1e8090bc832964c23a37a3db92c Mon Sep 17 00:00:00 2001 From: BigOokie <36015380+BigOokie@users.noreply.github.com> Date: Mon, 21 Oct 2019 19:10:22 +1100 Subject: [PATCH 6/9] Update following initial tests --- Formula/litcli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/litcli.rb b/Formula/litcli.rb index e6a957f..1f43781 100644 --- a/Formula/litcli.rb +++ b/Formula/litcli.rb @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -class litcli < Formula +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" From 063130c2eb404ccb800ee3260eba8cfa50ea1a16 Mon Sep 17 00:00:00 2001 From: BigOokie <36015380+BigOokie@users.noreply.github.com> Date: Mon, 21 Oct 2019 19:13:12 +1100 Subject: [PATCH 7/9] update install file name --- Formula/litcli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/litcli.rb b/Formula/litcli.rb index 1f43781..16cec89 100644 --- a/Formula/litcli.rb +++ b/Formula/litcli.rb @@ -30,6 +30,6 @@ class Litcli < Formula bottle :unneeded def install - bin.install "lit-cli" + bin.install "lit" end end \ No newline at end of file From e568da87722dc95d80f6b5854741d9ba615f492e Mon Sep 17 00:00:00 2001 From: BigOokie <36015380+BigOokie@users.noreply.github.com> Date: Mon, 21 Oct 2019 19:26:28 +1100 Subject: [PATCH 8/9] Rename the lit binary --- Formula/litcli.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Formula/litcli.rb b/Formula/litcli.rb index 16cec89..86a2d1b 100644 --- a/Formula/litcli.rb +++ b/Formula/litcli.rb @@ -30,6 +30,7 @@ class Litcli < Formula bottle :unneeded def install + mv bin/"lit_darwin_386", bin/"lit" bin.install "lit" end end \ No newline at end of file From 6607a425df59a3460803b3ac825b6c0549e9b772 Mon Sep 17 00:00:00 2001 From: BigOokie <36015380+BigOokie@users.noreply.github.com> Date: Mon, 21 Oct 2019 19:30:06 +1100 Subject: [PATCH 9/9] Updates following testing to rename file --- Formula/litcli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/litcli.rb b/Formula/litcli.rb index 86a2d1b..dfeb104 100644 --- a/Formula/litcli.rb +++ b/Formula/litcli.rb @@ -30,7 +30,7 @@ class Litcli < Formula bottle :unneeded def install - mv bin/"lit_darwin_386", bin/"lit" + mv "lit_darwin_386", "lit" bin.install "lit" end end \ No newline at end of file