@@ -26,12 +26,6 @@ COMMA := ,
26
26
27
27
XGO_VERSION := go-1.18.x
28
28
29
- MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2)
30
- MIN_GO_VERSION := $(shell printf "% 03d% 03d% 03d" $(shell echo '$(MIN_GO_VERSION_STR ) ' | tr '.' ' ') )
31
-
32
- MIN_NODE_VERSION_STR := $(shell grep -Eo '"node":.* [0-9.]+"' package.json | sed -n 's/.* [^0-9.]\([0-9.]* \) "/\1/p')
33
- MIN_NODE_VERSION := $(shell printf "% 03d% 03d% 03d" $(shell echo '$(MIN_NODE_VERSION_STR ) ' | tr '.' ' ') )
34
-
35
29
AIR_PACKAGE ?= github.com/cosmtrek/air@v1.29.0
36
30
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.4.0
37
31
ERRCHECK_PACKAGE ?= github.com/kisielk/errcheck@v1.6.0
@@ -207,12 +201,13 @@ help:
207
201
208
202
.PHONY : go-check
209
203
go-check :
204
+ $(eval MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2) )
205
+ $(eval MIN_GO_VERSION := $(shell printf "% 03d% 03d% 03d" $(shell echo '$(MIN_GO_VERSION_STR ) ' | tr '.' ' ') ) )
210
206
$(eval GO_VERSION := $(shell printf "% 03d% 03d% 03d" $(shell $(GO ) version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ') ;) )
211
207
@if [ " $( GO_VERSION) " -lt " $( MIN_GO_VERSION) " ]; then \
212
208
echo " Gitea requires Go $( MIN_GO_VERSION_STR) or greater to build. You can get it at https://go.dev/dl/" ; \
213
209
exit 1; \
214
210
fi
215
- @echo " checked go matches min version: $( MIN_GO_VERSION_STR) "
216
211
217
212
.PHONY : git-check
218
213
git-check :
@@ -223,13 +218,14 @@ git-check:
223
218
224
219
.PHONY : node-check
225
220
node-check :
221
+ $(eval MIN_NODE_VERSION_STR := $(shell grep -Eo '"node":.* [0-9.]+"' package.json | sed -n 's/.* [^0-9.]\([0-9.]* \) "/\1/p') )
222
+ $(eval MIN_NODE_VERSION := $(shell printf "% 03d% 03d% 03d" $(shell echo '$(MIN_NODE_VERSION_STR ) ' | tr '.' ' ') ) )
226
223
$(eval NODE_VERSION := $(shell printf "% 03d% 03d% 03d" $(shell node -v | cut -c2- | tr '.' ' ') ;) )
227
224
$(eval NPM_MISSING := $(shell hash npm > /dev/null 2>&1 || echo 1) )
228
225
@if [ " $( NODE_VERSION) " -lt " $( MIN_NODE_VERSION) " -o " $( NPM_MISSING) " = " 1" ]; then \
229
226
echo " Gitea requires Node.js $( MIN_NODE_VERSION_STR) or greater and npm to build. You can get it at https://nodejs.org/en/download/" ; \
230
227
exit 1; \
231
228
fi
232
- @echo " checked nodejs matches min version: $( MIN_NODE_VERSION_STR) "
233
229
234
230
.PHONY : clean-all
235
231
clean-all : clean
0 commit comments