Skip to content

Commit

Permalink
Move homebrew code to a submodule
Browse files Browse the repository at this point in the history
 - More tightly coupled to make releases easier
 - Small tweaks to readme
  • Loading branch information
synfinatic committed Nov 4, 2021
1 parent 4c9e5be commit 4fb4a3a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 43 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "homebrew"]
path = homebrew
url = [email protected]:synfinatic/homebrew-aws-sso-cli.git
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,25 @@ uninstall: ## Uninstall binary from $INSTALL_PREFIX
rm /usr/local/bin/$(PROJECT_NAME)


HOMEBREW := aws-sso-cli.rb
HOMEBREW := ./homebrew/Formula/aws-sso-cli.rb

homebrew: $(HOMEBREW) ## Build homebrew tap file

#DOWNLOAD_URL := https://synfin.net/misc/aws-sso-cli.$(PROJECT_VERSION).tar.gz
DOWNLOAD_URL ?= https://github.com/synfinatic/aws-sso-cli/archive/refs/tags/v$(PROJECT_VERSION).tar.gz

.PHONY: $(HOMEBREW)
$(HOMEBREW): brew/homebrew.rb ## no-help
$(HOMEBREW): homebrew/template.rb ## no-help
TEMPFILE=$$(mktemp) && wget -q -O $${TEMPFILE} $(DOWNLOAD_URL) ; \
if test -s $${TEMPFILE}; then \
export SHA=$$(cat $${TEMPFILE} | sha256sum | sed -e 's| -||') && rm $${TEMPFILE} && \
m4 -D __SHA256__=$${SHA} \
-D __VERSION__=$(PROJECT_VERSION) \
-D __COMMIT__=$(PROJECT_COMMIT) \
-D __URL__=$(DOWNLOAD_URL) \
brew/homebrew.rb | tee $(HOMEBREW) && \
homebrew/template.rb | tee $(HOMEBREW) && \
echo "***** Please review above and test! ******" && \
echo "File written to: $(HOMEBREW)" ; \
echo "File written to: $(HOMEBREW) Please commit in git submodule!" ; \
else \
echo "*** Error downloading $(DOWNLOAD_URL) ***" ; \
fi
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ The following functions are available in your template:
* `AccountIdStr(x)` -- Converts an AWS Account ID to a string
* `EmptyString(x)` -- Returns true/false if the value `x` is an empty string
* `FirstItem([]x)` -- Returns the first item in a list that is not an empty string
* `StringsJoin([]x, y) -- Joins the items in `x` with the string `y`
* `StringsJoin([]x, y)` -- Joins the items in `x` with the string `y`

**Note:** Unlike most values stored in the `config.yaml`, because `ProfileFormat`
values often start with a `{` you will need to quote the value for it to be valid
Expand Down Expand Up @@ -379,25 +379,25 @@ Valid options:

Valid low intensity colors:

* "Black"
* "DarkRed"
* "DarkGreen"
* "Brown"
* "DarkBlue"
* "Purple"
* "Cyan"
* "LightGrey"
* Black
* DarkRed
* DarkGreen
* Brown
* DarkBlue
* Purple
* Cyan
* LightGrey

Valid high intensity colors:

* "DarkGrey"
* "Red"
* "Green"
* "Yellow"
* "Blue"
* "Fuchsia"
* "Turquoise"
* "White"
* DarkGrey
* Red
* Green
* Yellow
* Blue
* Fuchsia
* Turquoise
* White


## Environment Varables
Expand Down
22 changes: 0 additions & 22 deletions brew/homebrew.rb

This file was deleted.

1 change: 1 addition & 0 deletions homebrew
Submodule homebrew added at e64448

0 comments on commit 4fb4a3a

Please sign in to comment.