forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre-commit.sh
More file actions
42 lines (34 loc) · 878 Bytes
/
Copy pathpre-commit.sh
File metadata and controls
42 lines (34 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
set -euxo pipefail
ANY_ERROR=false
set +e
if type tofu &>/dev/null; then
bash -ex .github/opentofu-fmt.sh
# shellcheck disable=SC2181
[[ $? -ne 0 ]] && ANY_ERROR=true
bash -ex .github/opentofu-validate.sh
# shellcheck disable=SC2181
[[ $? -ne 0 ]] && ANY_ERROR=true
fi
if type terraform &>/dev/null; then
bash -ex .github/terraform-fmt.sh
# shellcheck disable=SC2181
[[ $? -ne 0 ]] && ANY_ERROR=true
bash -ex .github/terraform-validate.sh
# shellcheck disable=SC2181
[[ $? -ne 0 ]] && ANY_ERROR=true
fi
if type shellcheck &>/dev/null; then
bash -ex .github/shellcheck.sh
# shellcheck disable=SC2181
[[ $? -ne 0 ]] && ANY_ERROR=true
fi
if type shfmt &>/dev/null; then
bash -ex .github/shfmt.sh
# shellcheck disable=SC2181
[[ $? -ne 0 ]] && ANY_ERROR=true
fi
set -e
if [[ "true" == "$ANY_ERROR" ]]; then
exit 1
fi