Skip to content

Commit 46411f0

Browse files
authored
Merge pull request #48 from khos2ow/sh-format
Format all shell scripts
2 parents a5a438f + 76b97b6 commit 46411f0

File tree

5 files changed

+164
-158
lines changed

5 files changed

+164
-158
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Run ShellCheck
1818
uses: ludeeus/action-shellcheck@master
1919
with:
20-
scandir: "./src"
20+
scandir: "."
2121

2222
readme:
2323
runs-on: ubuntu-latest

scripts/pre-release.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,28 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
set -e
17+
set -o errexit
18+
set -o pipefail
19+
set -o errtrace
1820

1921
NEW_VERSION=$1
2022
PWD=$(cd "$(dirname "$0")" && pwd -P)
2123

2224
if [ -z "${NEW_VERSION}" ]; then
23-
echo "Must have version like: v1.0.1"
24-
exit 1
25+
echo "Must have version like: v1.0.1"
26+
exit 1
2527
fi
2628

2729
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
2830

29-
if [[ "${CURRENT_BRANCH}" == "main" ]]; then
30-
git pull origin main
31-
git checkout -b "release/${NEW_VERSION}"
32-
elif [[ "${CURRENT_BRANCH}" == "release/${NEW_VERSION}" ]]; then
33-
git pull origin main
31+
if [ "${CURRENT_BRANCH}" = "main" ]; then
32+
git pull origin main
33+
git checkout -b "release/${NEW_VERSION}"
34+
elif [ "${CURRENT_BRANCH}" = "release/${NEW_VERSION}" ]; then
35+
git pull origin main
3436
else
35-
echo "Invalid branch"
36-
exit 1
37+
echo "Invalid branch"
38+
exit 1
3739
fi
3840

3941
# Update README

scripts/release.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,22 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
set -e
17+
set -o errexit
18+
set -o pipefail
19+
set -o errtrace
1820

1921
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
2022

2123
if [[ "${CURRENT_BRANCH}" != "main" ]]; then
22-
echo "Must be on main branch"
23-
exit 1
24+
echo "Must be on main branch"
25+
exit 1
2426
fi
2527

2628
NEW_VERSION=$1
2729

2830
if [ -z "${NEW_VERSION}" ]; then
29-
echo "Must have version like: v1.0.1"
30-
exit 1
31+
echo "Must have version like: v1.0.1"
32+
exit 1
3133
fi
3234

3335
git pull origin main

scripts/update-readme.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
set -e
17+
set -o errexit
18+
set -o pipefail
19+
set -o errtrace
1820

1921
NEW_VERSION=$1
2022

@@ -25,11 +27,11 @@ if [ -z "${NEW_VERSION}" ]; then
2527
fi
2628

2729
if [ -z "${NEW_VERSION}" ]; then
28-
echo "Must have version like: v1.0.1"
29-
exit 1
30+
echo "Must have version like: v1.0.1"
31+
exit 1
3032
fi
3133

3234
# Update the README
3335
VERSION=${NEW_VERSION} gomplate -d action="${PWD}"/../action.yml -f "${PWD}"/../.github/templates/README.tpl -o "${PWD}"/../README.md
3436

35-
echo "README.md updated."
37+
echo "README.md updated."

0 commit comments

Comments
 (0)