Skip to content

Commit

Permalink
chore: create dev-deps script
Browse files Browse the repository at this point in the history
  • Loading branch information
JGAntunes committed Nov 19, 2024
1 parent 800354e commit aa45728
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,24 @@ mock:
mockgen -source=pkg/handlers/interface.go -destination=pkg/handlers/mock/mock.go
mockgen -source=pkg/operator/client/client_interface.go -destination=pkg/operator/client/mock/mock.go

.PHONY: install-gomplate
install-gomplate:
go install github.com/hairyhenderson/gomplate/v4/cmd/gomplate@latest
.PHONY: dev-deps
dev-deps:
@dev/scripts/dev-deps.sh

.PHONY: dev
dev: install-gomplate
dev: dev-deps
@dev/scripts/dev.sh

.PHONY: %-up
%-up: install-gomplate
%-up: dev-deps
@dev/scripts/up.sh $*

.PHONY: %-down
%-down:
@dev/scripts/down.sh $*

.PHONY: %-up-ec
%-up-ec: install-gomplate
%-up-ec: dev-deps
@dev/scripts/up-ec.sh $*

.PHONY: %-down-ec
Expand Down
20 changes: 20 additions & 0 deletions dev/scripts/dev-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -e

function is_not_in_path() {
if ! which "$1" > /dev/null; then
echo "$1 is not installed"
return 0
fi
return 1
}

function check_gomplate() {
if is_not_in_path gomplate; then
echo "gomplate is not installed. Installing it now."
go install github.com/hairyhenderson/gomplate/v4/cmd/gomplate@latest
fi
}

check_gomplate

0 comments on commit aa45728

Please sign in to comment.