From b840c900ffe594bc1e127eed2b60e0a838d31ee9 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 8 Oct 2019 11:49:26 +0100 Subject: [PATCH] Move files back if linting fails --- scripts/find-lint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/find-lint.sh b/scripts/find-lint.sh index 25b311f94..8917e7abd 100755 --- a/scripts/find-lint.sh +++ b/scripts/find-lint.sh @@ -30,7 +30,9 @@ cp go.mod go.mod.bak && cp go.sum go.sum.bak go get github.com/golangci/golangci-lint/cmd/golangci-lint echo "Looking for lint..." -golangci-lint run $args +# Run linting +# Ensure module files or moved back even if the linting command fails +golangci-lint run $args || echo "Linting execution failed..." # Restore go.{mod,sum} mv go.mod.bak go.mod && mv go.sum.bak go.sum