mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-29 09:31:11 -05:00
d77176912b
* Migrate to go modules * make vendor * Update mvdan.cc/xurls * make vendor * Update code.gitea.io/git * make fmt-check * Update github.com/go-sql-driver/mysql * make vendor
21 lines
439 B
Bash
Vendored
21 lines
439 B
Bash
Vendored
#!/bin/bash
|
|
# ln -s $PWD/pre-commit.sh .git/hooks/pre-commit
|
|
go test *.go
|
|
RESULT=$?
|
|
if [[ $RESULT != 0 ]]; then
|
|
echo "REJECTING COMMIT (test failed with status: $RESULT)"
|
|
exit 1;
|
|
fi
|
|
|
|
go fmt *.go
|
|
for e in $(ls examples); do
|
|
go build examples/$e/*.go
|
|
RESULT=$?
|
|
if [[ $RESULT != 0 ]]; then
|
|
echo "REJECTING COMMIT (Examples failed to compile)"
|
|
exit $RESULT;
|
|
fi
|
|
go fmt examples/$e/*.go
|
|
done
|
|
|
|
exit 0
|