mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 11:34:59 +08:00
fix(release): 完成分发证明代际绑定与质量门禁收口
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "${repo_root}"
|
||||
|
||||
: "${GOCACHE:=/tmp/bat-go-cache}"
|
||||
export GOCACHE
|
||||
|
||||
mapfile -t go_dirs < <(go list -f '{{.Dir}}' ./...)
|
||||
go_files=()
|
||||
for dir in "${go_dirs[@]}"; do
|
||||
while IFS= read -r -d '' file; do
|
||||
go_files+=("${file}")
|
||||
done < <(find "${dir}" -maxdepth 1 -type f -name '*.go' -print0)
|
||||
done
|
||||
|
||||
if ((${#go_files[@]} == 0)); then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
formatted="$(gofmt -l "${go_files[@]}")"
|
||||
if [[ -n "${formatted}" ]]; then
|
||||
printf 'gofmt required; files need formatting:\n%s\n' "${formatted}" >&2
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user