Skip to content

Commit

Permalink
feat: improve installing tools (#7)
Browse files Browse the repository at this point in the history
Signed-off-by: tkrop <[email protected]>
  • Loading branch information
tkrop authored Jan 4, 2024
1 parent 9e55ca4 commit 0e3e8d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else
endif

GOBIN ?= $(shell go env GOPATH)/bin
GOMAKE ?= github.com/tkrop/[email protected].14
GOMAKE ?= github.com/tkrop/[email protected].15
TARGETS := $(shell command -v go-make >/dev/null || \
go install $(GOMAKE) && go-make targets)

Expand Down
8 changes: 4 additions & 4 deletions Makefile.base
Original file line number Diff line number Diff line change
Expand Up @@ -448,27 +448,27 @@ install-all:: $(TARGETS_INSTALL_ALL)

# install go tools used by the project.
$(TARGETS_INSTALL_GO):: install-%: $(GOBIN)/%
$(addprefix $(GOBIN)/,$(COMMANDS_GO)):: $(GOBIN)/%:
$(addprefix $(GOBIN)/,$(COMMANDS_GO)): $(GOBIN)/%:
go install $(call go-pkg,install,$(TOOLS_GO),^$*$$);
# install go tools providing an install.sh script.
$(TARGETS_INSTALL_SH):: install-%: $(GOBIN)/%
$(addprefix $(GOBIN)/,$(COMMANDS_SH)):: $(GOBIN)/%:
$(addprefix $(GOBIN)/,$(COMMANDS_SH)): $(GOBIN)/%:
@if ! command -v $*; then \
curl --silent --show-error --fail --location \
https://raw.githubusercontent.com/anchore/$*/main/install.sh | \
sh -s -- -b $(GOBIN); \
fi;
# install npm tools used by the project.
$(TARGETS_INSTALL_NPM):: install-%: $(NVM_BIN)/%
$(addprefix $(NVM_BIN)/,$(TOOLS_NPM:-cli=)):: $(NVM_BIN)/%:
$(addprefix $(NVM_BIN)/,$(TOOLS_NPM:-cli=)): $(NVM_BIN)/%:
@if command -v npm &> /dev/null && ! command -v $*; then \
echo "npm install --global ^$*$$"; \
npm install --global $(filter $*-cli,$(TOOLS_NPM)); \
fi;

#@ install software command or service created by the project.
$(TARGETS_INSTALL):: install-%: $(GOBIN)/%
$(addprefix $(GOBIN)/,$(COMMANDS)):: $(GOBIN)/%: $(DIR_BUILD)/%
$(addprefix $(GOBIN)/,$(COMMANDS)): $(GOBIN)/%: $(DIR_BUILD)/%
cp -f $< $(GOBIN)/$*;

#@ uninstall all software created by the project.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.14
0.0.15

0 comments on commit 0e3e8d1

Please sign in to comment.