From 82bcce7bdc76e10e23050b84812202a1b13b0870 Mon Sep 17 00:00:00 2001 From: Gemini Smith Date: Wed, 1 Dec 2021 08:22:04 -0700 Subject: [PATCH] Add WSL friendly check-go-version setup (#443) * Add WSL friendly check-go-version setup * Add changelog entry and update my username * Add PR link to changelog * Stop it saying 'noting to be done for check-go-version' * Update CHANGELOG.md Co-authored-by: Viacheslav Poturaev Co-authored-by: Matt Wynne Co-authored-by: Viacheslav Poturaev --- CHANGELOG.md | 20 +++++++++++++------- Makefile | 4 +++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b150d29..9d8132a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt --- +## [Unreleased] + +### Fixed + +- `check-go-version` in Makefile to run on WSL. ([443](https://github.com/cucumber/godog/pull/443) - [mxygem]) + ## [v0.12.2] ### Fixed @@ -146,8 +152,8 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt ### Changed -- Run godog features in CircleCI in strict mode ([jaysonesmith]) -- Removed TestMain call in `suite_test.go` for CI. ([jaysonesmith]) +- Run godog features in CircleCI in strict mode ([mxygem]) +- Removed TestMain call in `suite_test.go` for CI. ([mxygem]) - Migrated to [gherkin-go - v11.0.0](https://github.com/cucumber/gherkin-go/releases/tag/v11.0.0). ([240](https://github.com/cucumber/godog/pull/240) - [lonnblad]) ### Deprecated @@ -158,7 +164,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt - Fixed the time attributes in the JUnit formatter. ([232](https://github.com/cucumber/godog/pull/232) - [lonnblad]) - Re enable custom formatters. ([238](https://github.com/cucumber/godog/pull/238) - [ericmcbride]) -- Added back suite_test.go ([jaysonesmith]) +- Added back suite_test.go ([mxygem]) - Normalise module paths for use on Windows ([242](https://github.com/cucumber/godog/pull/242) - [gjtaylor]) - Fixed panic in indenting function `s` ([247](https://github.com/cucumber/godog/pull/247) - [titouanfreville]) - Fixed wrong version in API example ([263](https://github.com/cucumber/godog/pull/263) - [denis-trofimov]) @@ -181,18 +187,18 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt ### Fixed - Find/Replaced references to DATA-DOG/godog -> cucumber/godog for docs. ([209](https://github.com/cucumber/godog/pull/209) - [smikulcik]) -- Fixed missing links in changelog to be correctly included! ([jaysonesmith]) +- Fixed missing links in changelog to be correctly included! ([mxygem]) ## [0.8.0] ### Added -- Added initial CircleCI config. ([jaysonesmith]) +- Added initial CircleCI config. ([mxygem]) - Added concurrency support for JUnit formatting ([lonnblad]) ### Changed -- Changed code references to DATA-DOG/godog to cucumber/godog to help get things building correctly. ([jaysonesmith]) +- Changed code references to DATA-DOG/godog to cucumber/godog to help get things building correctly. ([mxygem]) ### Deprecated @@ -214,7 +220,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt [axw]: https://github.com/axw -[jaysonesmith]: https://github.com/jaysonesmith +[mxygem]: https://github.com/mxygem [lonnblad]: https://github.com/lonnblad [smikulcik]: https://github.com/smikulcik [ericmcbride]: https://github.com/ericmcbride diff --git a/Makefile b/Makefile index adf773e..ffdcb8e 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,11 @@ VERS := $(shell grep 'const Version' -m 1 godog.go | awk -F\" '{print $$2}') +FOUND_GO_VERSION := $(shell go version) EXPECTED_GO_VERSION = 1.17 +.PHONY: check-go-version check-go-version: - @[[ "$(shell go version)" =~ $(EXPECTED_GO_VERSION) ]] || (echo Wrong go version! Please install $(EXPECTED_GO_VERSION) && exit 1) + @$(if $(findstring ${EXPECTED_GO_VERSION}, ${FOUND_GO_VERSION}),(exit 0),(echo Wrong go version! Please install ${EXPECTED_GO_VERSION}; exit 1)) test: check-go-version @echo "running all tests"