Skip to content

Commit

Permalink
chore: use strict mode for tests/*/*.sh
Browse files Browse the repository at this point in the history
REF: etcd-io#15514

Signed-off-by: Wei Fu <fuweid89@gmail.com>
  • Loading branch information
fuweid committed Apr 13, 2023
1 parent 78d2ead commit 8cd5969
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
12 changes: 9 additions & 3 deletions tests/fixtures/gencerts.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
11 changes: 10 additions & 1 deletion tests/integration/fixtures-expired/gencerts.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 8cd5969

Please sign in to comment.