mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
174d24460c
* chore(go): add pre-commit hook run go mod tidy add description * use bash * adjust indentation * fix code climate issue * docs: clarify git hook usage description * Update .hooks/README.md
12 lines
198 B
Bash
Executable File
12 lines
198 B
Bash
Executable File
#!/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
|