chore: use strict mode for tests/*/*.sh

REF: #15514

Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
Wei Fu 2023-04-09 12:40:05 +08:00
parent 78d2ead804
commit 8cd5969248
2 changed files with 19 additions and 4 deletions

View File

@ -1,15 +1,21 @@
#!/bin/bash
set -e
set -euo pipefail
if ! [[ "$0" =~ "./gencerts.sh" ]]; then
echo "must be run from 'fixtures'"
exit 255
fi
if ! which cfssl; then
if ! command -v cfssl; then
echo "cfssl is not installed"
echo "use: go install -mod mod github.com/cloudflare/cfssl/cmd/cfssl github.com/cloudflare/cfssl/cmd/cfssljson"
echo "use: go install -mod mod github.com/cloudflare/cfssl/cmd/cfssl"
exit 255
fi
if ! command -v cfssljson; then
echo "cfssljson is not installed"
echo "use: go install -mod mod github.com/cloudflare/cfssl/cmd/cfssljson"
exit 255
fi

View File

@ -1,12 +1,21 @@
#!/bin/bash
set -euo pipefail
if ! [[ "$0" =~ "./gencerts.sh" ]]; then
echo "must be run from 'fixtures'"
exit 255
fi
if ! which cfssl; then
if ! command -v cfssl; then
echo "cfssl is not installed"
echo "use: go install -mod mod github.com/cloudflare/cfssl/cmd/cfssl"
exit 255
fi
if ! command -v cfssljson; then
echo "cfssljson is not installed"
echo "use: go install -mod mod github.com/cloudflare/cfssl/cmd/cfssljson"
exit 255
fi