Skip mdgen build in case of valid mdgen in Makefile (#1214)

## Description

`_validatemdgen` resulted in the build for mdgen to always happen. This fixes that.

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [x] 🗺️ Documentation
- [ ] 🤖 Test
- [x] 💻 CI/Deployment
- [ ] 🐹 Trivial/Minor

## Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* #<issue>

## Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
Abin Simon 2022-10-20 05:49:41 +05:30 committed by GitHub
parent afa8734268
commit 6846ebf964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,15 +39,16 @@ dockershell:
build: genclidocs build: genclidocs
$(DOCSC) npm run build $(DOCSC) npm run build
genclidocs: ${MDGEN_BINARY} genclidocs: _validatemdgen ${MDGEN_BINARY}
@echo 'Auto-generating Corso CLI docs...' @echo 'Auto-generating Corso CLI docs...'
$(DOCSC) rm -rf docs/cli $(DOCSC) rm -rf docs/cli
$(GOC) ${MDGEN_BINARY} --cli-folder ${CLI_DOCS} $(GOC) ${MDGEN_BINARY} --cli-folder ${CLI_DOCS}
_validatemdgen: # in case we have a different architecture _validatemdgen: # in case we have a different architecture
@echo 'Verifying dependencies...'
$(GOC) ${MDGEN_BINARY} --help >/dev/null || $(GOC) rm -rf ${MDGEN_BINARY} $(GOC) ${MDGEN_BINARY} --help >/dev/null || $(GOC) rm -rf ${MDGEN_BINARY}
${MDGEN_BINARY}: $(shell find ${CORSO_LOCAL_PATH}/src -type f -name *.go) $(shell find ${CORSO_LOCAL_PATH}/src -type d ) _validatemdgen ${MDGEN_BINARY}: $(shell find ${CORSO_LOCAL_PATH}/src -type f -name *.go) $(shell find ${CORSO_LOCAL_PATH}/src -type d )
@echo 'Re-building Corso CLI docs auto-gen tooling...' @echo 'Re-building Corso CLI docs auto-gen tooling...'
$(GOC) go mod download $(GOC) go mod download
$(GOC) go build -o ${MDGEN_BINARY} ${MDGEN_SRC} $(GOC) go build -o ${MDGEN_BINARY} ${MDGEN_SRC}