Skip to content

Commit 6fe579c

Browse files
committed
Split shell commands into multiple lines for readability
The project's GitHub Actions workflows and tasks contain complex shell command lines. With the use of the line continuation operator, these commands can be split into multiple code lines. This improves readability by providing a visualization of the command structure and avoiding excessive line lengths. It also improves maintainability by making diffs for changes to these commands more clear. Previously this was done in many commands, but not consistently throughout the project.
1 parent 32d1021 commit 6fe579c

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

.github/workflows/release-go-task.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ jobs:
169169
- name: Write gon config to file
170170
# gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20)
171171
run: |
172-
cat >"${{ env.GON_CONFIG_PATH }}" <<EOF
172+
cat >"${{ env.GON_CONFIG_PATH }}" \
173+
<<EOF
173174
# See: https://github.com/Bearer/gon#configuration-file
174175
source = ["${{ env.DIST_DIR }}/${{ env.BUILD_FOLDER }}/${{ env.PROJECT_NAME }}"]
175176
bundle_id = "cc.arduino.${{ env.PROJECT_NAME }}"

Taskfile.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,10 @@ tasks:
197197
- task: general:prepare-deps
198198
cmds:
199199
- |
200-
if ! which licensed &>/dev/null; then
200+
if
201+
! which licensed \
202+
&>/dev/null
203+
then
201204
if [[ {{OS}} == "windows" ]]; then
202205
echo "Licensed does not have Windows support."
203206
echo "Please use Linux/macOS or download the dependencies cache from the GitHub Actions workflow artifact."
@@ -606,13 +609,19 @@ tasks:
606609
run: when_changed
607610
cmds:
608611
- |
609-
if ! which go &>/dev/null; then
612+
if
613+
! which go \
614+
&>/dev/null
615+
then
610616
echo "Go not found or not in PATH."
611617
echo "Please install: https://go.dev/doc/install"
612618
exit 1
613619
fi
614620
- |
615-
if ! which python &>/dev/null; then
621+
if
622+
! which python \
623+
&>/dev/null
624+
then
616625
python_constraint="$( \
617626
yq \
618627
--input-format toml \
@@ -627,7 +636,10 @@ tasks:
627636
exit 1
628637
fi
629638
- |
630-
if ! which pipx &>/dev/null; then
639+
if
640+
! which pipx \
641+
&>/dev/null
642+
then
631643
echo "pipx not found or not in PATH."
632644
echo "Please install: https://pipx.pypa.io/stable/installation/#installing-pipx"
633645
exit 1
@@ -734,7 +746,10 @@ tasks:
734746
exit 1
735747
fi
736748
- |
737-
if ! which shellcheck &>/dev/null; then
749+
if
750+
! which shellcheck \
751+
&>/dev/null
752+
then
738753
echo "shellcheck not installed or not in PATH."
739754
echo "Please install: https://github.com/koalaman/shellcheck#installing"
740755
exit 1
@@ -774,7 +789,10 @@ tasks:
774789
exit 1
775790
fi
776791
- |
777-
if ! which shfmt &>/dev/null; then
792+
if
793+
! which shfmt \
794+
&>/dev/null
795+
then
778796
echo "shfmt not installed or not in PATH. Please install: https://github.com/mvdan/sh#shfmt"
779797
exit 1
780798
fi

0 commit comments

Comments
 (0)