Fix error messages when checking go version
@@ -47,23 +47,21 @@ MIN_REQUIRED_GO_VERSION_MAJOR = 1
MIN_REQUIRED_GO_VERSION_MINOR = 15
MIN_REQUIRED_GO_VERSION_PATCH = 7
-GO_VERSION_MESSAGE = Installed Go version is $(GO_VERSION_MAJOR).$(GO_VERSION_MINOR).$(GO_VERSION_PATCH). OSM requires Go version $(MIN_REQUIRED_GO_VERSION_MAJOR).$(MIN_REQUIRED_GO_VERSION_MINOR).$(MIN_REQUIRED_GO_VERSION_PATCH) or higher!
+GO_VERSION_MESSAGE = "Installed Go version is $(GO_VERSION_MAJOR).$(GO_VERSION_MINOR).$(GO_VERSION_PATCH).\n OSM requires Go version $(MIN_REQUIRED_GO_VERSION_MAJOR).$(MIN_REQUIRED_GO_VERSION_MINOR).$(MIN_REQUIRED_GO_VERSION_PATCH) or higher!\n\n"
check-go-version: # Ensure the Go version used is what OSM requires
- @echo -e "Installed Go version is $(GO_VERSION_MAJOR).$(GO_VERSION_MINOR).$(GO_VERSION_PATCH)."
- @echo -e "OSM requires Go version $(MIN_REQUIRED_GO_VERSION_MAJOR).$(MIN_REQUIRED_GO_VERSION_MINOR).$(MIN_REQUIRED_GO_VERSION_PATCH) or higher!\n\n"
@if [ $(GO_VERSION_MAJOR) -gt $(MIN_REQUIRED_GO_VERSION_MAJOR) ]; then \
exit 0 ;\
elif [ $(GO_VERSION_MAJOR) -lt $(MIN_REQUIRED_GO_VERSION_MAJOR) ]; then \
- echo '$(GO_VERSION_MESSAGE)';\
+ @echo -e '$(GO_VERSION_MESSAGE)';\
exit 1; \
elif [ $(GO_VERSION_MINOR) -gt $(MIN_REQUIRED_GO_VERSION_MINOR) ] ; then \
exit 0; \
elif [ $(GO_VERSION_MINOR) -lt $(MIN_REQUIRED_GO_VERSION_MINOR) ] ; then \
- echo '$(GO_VERSION_MESSAGE)';\
+ @echo -e '$(GO_VERSION_MESSAGE)';\
exit 1; \
elif [ $(GO_VERSION_PATCH) -lt $(MIN_REQUIRED_GO_VERSION_PATCH) ] ; then \
- echo '$(GO_VERSION_MESSAGE)';\
+ @echo -e '$(GO_VERSION_MESSAGE)';\
exit 1; \
fi
