1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-16 11:09:33 +02:00
sap-jenkins-library/.hooks/pre-commit

12 lines
198 B
Plaintext
Raw Normal View History

#!/bin/bash
STAGED_GO_FILES=$(git diff --staged --name-only | grep "\.go$")
if [[ "$STAGED_GO_FILES" = "" ]]; then
exit 0
fi
echo "cleaning GO dependencies"
go mod tidy
git add go.mod go.sum