Skip to content

Commit 99cf52d

Browse files
committed
Improve bash code style
1 parent 81e0392 commit 99cf52d

File tree

2 files changed

+33
-22
lines changed

2 files changed

+33
-22
lines changed

.github/workflows/unset-environment-new-cli.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,34 +55,40 @@ jobs:
5555
TEST_MODE: true
5656
- shell: bash
5757
run: |
58-
CPP_DB=${{ fromJson(steps.analysis.outputs.db-locations).cpp }}
58+
CPP_DB="${{ fromJson(steps.analysis.outputs.db-locations).cpp }}"
5959
if [[ ! -d $CPP_DB ]] || [[ ! $CPP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
60-
echo "Did not create a database for CPP, or created it in the wrong location."
60+
echo "Did not create a database for CPP, or created it in the wrong location." \
61+
"Expected location was '${ runner.temp }'/customDbLocation/* but actual was '${ CPP_DB }'"
6162
exit 1
6263
fi
63-
CSHARP_DB=${{ fromJson(steps.analysis.outputs.db-locations).csharp }}
64+
CSHARP_DB="${{ fromJson(steps.analysis.outputs.db-locations).csharp }}"
6465
if [[ ! -d $CSHARP_DB ]] || [[ ! $CSHARP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
65-
echo "Did not create a database for C Sharp, or created it in the wrong location."
66+
echo "Did not create a database for C Sharp, or created it in the wrong location." \
67+
"Expected location was '${ runner.temp }'/customDbLocation/* but actual was '${ CSHARP_DB }'"
6668
exit 1
6769
fi
68-
GO_DB=${{ fromJson(steps.analysis.outputs.db-locations).go }}
70+
GO_DB="${{ fromJson(steps.analysis.outputs.db-locations).go }}"
6971
if [[ ! -d $GO_DB ]] || [[ ! $GO_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
70-
echo "Did not create a database for Go, or created it in the wrong location."
72+
echo "Did not create a database for Go, or created it in the wrong location." \
73+
"Expected location was '${ runner.temp }'/customDbLocation/* but actual was '${ GO_DB }'"
7174
exit 1
7275
fi
73-
JAVA_DB=${{ fromJson(steps.analysis.outputs.db-locations).java }}
76+
JAVA_DB="${{ fromJson(steps.analysis.outputs.db-locations).java }}"
7477
if [[ ! -d $JAVA_DB ]] || [[ ! $JAVA_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
75-
echo "Did not create a database for Java, or created it in the wrong location."
78+
echo "Did not create a database for Java, or created it in the wrong location." \
79+
"Expected location was '${ runner.temp }'/customDbLocation/* but actual was '${ JAVA_DB }'"
7680
exit 1
7781
fi
78-
JAVASCRIPT_DB=${{ fromJson(steps.analysis.outputs.db-locations).javascript }}
82+
JAVASCRIPT_DB="${{ fromJson(steps.analysis.outputs.db-locations).javascript }}"
7983
if [[ ! -d $JAVASCRIPT_DB ]] || [[ ! $JAVASCRIPT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
80-
echo "Did not create a database for Javascript, or created it in the wrong location."
84+
echo "Did not create a database for Javascript, or created it in the wrong location." \
85+
"Expected location was '${ runner.temp }'/customDbLocation/* but actual was '${ JAVASCRIPT_DB }'"
8186
exit 1
8287
fi
83-
PYTHON_DB=${{ fromJson(steps.analysis.outputs.db-locations).python }}
88+
PYTHON_DB="${{ fromJson(steps.analysis.outputs.db-locations).python }}"
8489
if [[ ! -d $PYTHON_DB ]] || [[ ! $PYTHON_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
85-
echo "Did not create a database for Python, or created it in the wrong location."
90+
echo "Did not create a database for Python, or created it in the wrong location." \
91+
"Expected location was '${ runner.temp }'/customDbLocation/* but actual was '${ PYTHON_DB }'"
8692
exit 1
8793
fi
8894
env:

.github/workflows/unset-environment-old-cli.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,29 +55,34 @@ jobs:
5555
TEST_MODE: true
5656
- shell: bash
5757
run: |
58-
CPP_DB=${{ fromJson(steps.analysis.outputs.db-locations).cpp }}
58+
CPP_DB="${{ fromJson(steps.analysis.outputs.db-locations).cpp }}"
5959
if [[ ! -d $CPP_DB ]] || [[ ! $CPP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
60-
echo "Did not create a database for CPP, or created it in the wrong location."
60+
echo "Did not create a database for CPP, or created it in the wrong location." \
61+
"Expected location was '${ runner.temp }'/customDbLocation/* but actual was '${ CPP_DB }'"
6162
exit 1
6263
fi
63-
CSHARP_DB=${{ fromJson(steps.analysis.outputs.db-locations).csharp }}
64+
CSHARP_DB="${{ fromJson(steps.analysis.outputs.db-locations).csharp }}"
6465
if [[ ! -d $CSHARP_DB ]] || [[ ! $CSHARP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
65-
echo "Did not create a database for C Sharp, or created it in the wrong location."
66+
echo "Did not create a database for C Sharp, or created it in the wrong location." \
67+
"Expected location was '${ runner.temp }'/customDbLocation/* but actual was '${ CSHARP_DB }'"
6668
exit 1
6769
fi
68-
GO_DB=${{ fromJson(steps.analysis.outputs.db-locations).go }}
70+
GO_DB="${{ fromJson(steps.analysis.outputs.db-locations).go }}"
6971
if [[ ! -d $GO_DB ]] || [[ ! $GO_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
70-
echo "Did not create a database for Go, or created it in the wrong location."
72+
echo "Did not create a database for Go, or created it in the wrong location." \
73+
"Expected location was '${ runner.temp }'/customDbLocation/* but actual was '${ GO_DB }'"
7174
exit 1
7275
fi
73-
JAVASCRIPT_DB=${{ fromJson(steps.analysis.outputs.db-locations).javascript }}
76+
JAVASCRIPT_DB="${{ fromJson(steps.analysis.outputs.db-locations).javascript }}"
7477
if [[ ! -d $JAVASCRIPT_DB ]] || [[ ! $JAVASCRIPT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
75-
echo "Did not create a database for Javascript, or created it in the wrong location."
78+
echo "Did not create a database for Javascript, or created it in the wrong location." \
79+
"Expected location was '${ runner.temp }'/customDbLocation/* but actual was '${ JAVASCRIPT_DB }'"
7680
exit 1
7781
fi
78-
PYTHON_DB=${{ fromJson(steps.analysis.outputs.db-locations).python }}
82+
PYTHON_DB="${{ fromJson(steps.analysis.outputs.db-locations).python }}"
7983
if [[ ! -d $PYTHON_DB ]] || [[ ! $PYTHON_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
80-
echo "Did not create a database for Python, or created it in the wrong location."
84+
echo "Did not create a database for Python, or created it in the wrong location." \
85+
"Expected location was '${ runner.temp }'/customDbLocation/* but actual was '${ PYTHON_DB }'"
8186
exit 1
8287
fi
8388
env:

0 commit comments

Comments
 (0)