Mk/Uses/go.mk: fix gomod-clean target when lang/go is not installed
make distclean target will break when lang/go is not installed. This provides an informational feedback and skips the gomod-clean target if go executable is not available. PR: 258359 MFH: 2021Q4 Submitted by: Rin Morningstar <ports.maintainer@evilphi.com> Reviewed by: dmgk Differential Revision: https://reviews.freebsd.org/D32054
This commit is contained in:
parent
86536a8e65
commit
f76516f110
1 changed files with 4 additions and 0 deletions
|
@ -215,8 +215,12 @@ do-test:
|
|||
|
||||
.if ${go_ARGS:Mmodules} && defined(GO_MODULE)
|
||||
gomod-clean:
|
||||
.if exists(${GO_CMD})
|
||||
@${ECHO_MSG} "===> Cleaning Go module cache"
|
||||
@${SETENV} ${GO_ENV} ${GO_CMD} clean -modcache
|
||||
.else
|
||||
@${ECHO_MSG} "===> Skipping since ${GO_CMD} is not installed"
|
||||
.endif
|
||||
|
||||
# Hook up to distclean
|
||||
.if !target(post-clean) && !make(clean)
|
||||
|
|
Loading…
Reference in a new issue