mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #14872 from HeavenTonight/fix-makefile
Make sure shellcheck exist
This commit is contained in:
commit
b851eac5b9
1
Makefile
1
Makefile
@ -141,4 +141,5 @@ clean:
|
||||
rm -rf ./release
|
||||
rm -rf ./coverage/*.err ./coverage/*.out
|
||||
rm -rf ./tests/e2e/default.proxy
|
||||
rm -rf ./bin/shellcheck*
|
||||
find ./ -name "127.0.0.1:*" -o -name "localhost:*" -o -name "*.log" -o -name "agent-*" -o -name "*.coverprofile" -o -name "testname-proxy-*" -delete
|
||||
|
@ -53,6 +53,7 @@ fi
|
||||
|
||||
PASSES=${PASSES:-"fmt bom dep build unit"}
|
||||
PKG=${PKG:-}
|
||||
SHELLCHECK_VERSION=${SHELLCHECK_VERSION:-"v0.8.0"}
|
||||
|
||||
if [ -z "$GOARCH" ]; then
|
||||
GOARCH=$(go env GOARCH);
|
||||
@ -388,9 +389,15 @@ function cov_pass {
|
||||
######### Code formatting checkers #############################################
|
||||
|
||||
function shellcheck_pass {
|
||||
if tool_exists "shellcheck" "https://github.com/koalaman/shellcheck#installing"; then
|
||||
generic_checker run shellcheck -fgcc scripts/*.sh
|
||||
SHELLCHECK=shellcheck
|
||||
if ! tool_exists "shellcheck" "https://github.com/koalaman/shellcheck#installing"; then
|
||||
log_callout "Installing shellcheck $SHELLCHECK_VERSION"
|
||||
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar -xJv -C /tmp/ --strip-components=1
|
||||
mkdir -p ./bin
|
||||
mv /tmp/shellcheck ./bin/
|
||||
SHELLCHECK=./bin/shellcheck
|
||||
fi
|
||||
generic_checker run ${SHELLCHECK} -fgcc scripts/*.sh
|
||||
}
|
||||
|
||||
function shellws_pass {
|
||||
|
Loading…
x
Reference in New Issue
Block a user