Skip to content

Commit

Permalink
feat; improve make-init (#11)
Browse files Browse the repository at this point in the history
Signed-off-by: tkrop <[email protected]>
  • Loading branch information
tkrop committed Jan 4, 2024
1 parent 3df8b3e commit d1dab5b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 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].17
GOMAKE ?= github.com/tkrop/[email protected].18
TARGETS := $(shell command -v go-make >/dev/null || \
go install $(GOMAKE) && go-make targets)

Expand Down
6 changes: 3 additions & 3 deletions Makefile.base
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,13 @@ $(TARGETS_INIT_CODACY):: init-%:
chmod 700 $${FILE}; \
fi; \

#@ initialize project by copying config makefile from template.
init-make:: $(TARGETS_INIT_MAKE)
#@ initialize project by copying config files from template.
init-make:: $(TARGETS_INIT_MAKE) $(TARGETS_UPDATE_MAKE)
$(TARGETS_INIT_MAKE):: init/%: setup/base
@DIR="$$(pwd)"; FILE="$*"; FILE="$${FILE##$(DIR_CONFIG)}"; \
cd "$(BASEDIR)"; git show HEAD:config/$${FILE} > $${DIR}/$${FILE} 2>/dev/null; \

#@ initialize project by copying Makefile.base from template.
#@ initialize project by copying raw Makefile.base from template.
init-make!:: setup/base
@DIR="$$(pwd)"; cd $(BASEDIR); \
git show HEAD:config/Makefile.base > $${DIR}/Makefile 2>/dev/null; \
Expand Down
1 change: 1 addition & 0 deletions Makefile.ext
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ clean::
bump::
@VERSION="$$(cat VERSION)"; \
sed -i -e "s#\(github.com/tkrop/go-make@v\)[^ ]*#\1$${VERSION}#" Makefile;
cp Makefile Makefile.base config;

commit::
@for FILE in $$(find config -type f ! -name "Makefile.vars"); do \
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.17
0.0.18
2 changes: 1 addition & 1 deletion config/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].17
GOMAKE ?= github.com/tkrop/[email protected].18
TARGETS := $(shell command -v go-make >/dev/null || \
go install $(GOMAKE) && go-make targets)

Expand Down
6 changes: 3 additions & 3 deletions config/Makefile.base
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,13 @@ $(TARGETS_INIT_CODACY):: init-%:
chmod 700 $${FILE}; \
fi; \

#@ initialize project by copying config makefile from template.
init-make:: $(TARGETS_INIT_MAKE)
#@ initialize project by copying config files from template.
init-make:: $(TARGETS_INIT_MAKE) $(TARGETS_UPDATE_MAKE)
$(TARGETS_INIT_MAKE):: init/%: setup/base
@DIR="$$(pwd)"; FILE="$*"; FILE="$${FILE##$(DIR_CONFIG)}"; \
cd "$(BASEDIR)"; git show HEAD:config/$${FILE} > $${DIR}/$${FILE} 2>/dev/null; \

#@ initialize project by copying Makefile.base from template.
#@ initialize project by copying raw Makefile.base from template.
init-make!:: setup/base
@DIR="$$(pwd)"; cd $(BASEDIR); \
git show HEAD:config/Makefile.base > $${DIR}/Makefile 2>/dev/null; \
Expand Down

0 comments on commit d1dab5b

Please sign in to comment.