Skip to content

Commit 3740adc

Browse files
committed
Script: Fix =~ bug
1 parent ec8eb99 commit 3740adc

2 files changed

Lines changed: 9 additions & 14 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,24 +181,21 @@ jobs:
181181
run: |
182182
if [ -f ${{github.workspace}}/Script/common.sh ]; then
183183
source ${{github.workspace}}/Script/common.sh
184-
185-
content=$(<${{github.workspace}}/ChangeLog.md)
186-
if [[ $content =~ ${{env.RabbitRemoteControl_VERSION}} ]]; then
184+
content=$(<"${{github.workspace}}/ChangeLog.md")
185+
if [[ $content =~ "${{env.RabbitRemoteControl_VERSION}}" ]]; then
187186
echo "## :us: Change log" >> ${{github.workspace}}/Release.md
188187
echo "" >> ${{github.workspace}}/Release.md
189188
get_section ${{github.workspace}}/ChangeLog.md >> ${{github.workspace}}/Release.md
190189
echo "" >> ${{github.workspace}}/Release.md
191190
fi
192-
193-
# content=$(<${{github.workspace}}/ChangeLog_zh_CN.md)
194-
# if [[ $content =~ ${{env.RabbitRemoteControl_VERSION}} ]]; then
191+
# content=$(<"${{github.workspace}}/ChangeLog_zh_CN.md")
192+
# if [[ $content =~ "${{env.RabbitRemoteControl_VERSION}}" ]]; then
195193
# echo "## :cn: 修改日志" >> ${{github.workspace}}/Release.md
196194
# echo "" >> ${{github.workspace}}/Release.md
197195
# get_section ${{github.workspace}}/ChangeLog_zh_CN.md >> ${{github.workspace}}/Release.md
198196
# echo "" >> ${{github.workspace}}/Release.md
199197
# fi
200198
fi
201-
202199
echo "-------------------------" >> ${{github.workspace}}/Release.md
203200
# 因为其它网站也可能需要,所以用完整的 URL
204201
echo "|:us: English|:cn: 中文|" >> ${{github.workspace}}/Release.md
@@ -218,16 +215,14 @@ jobs:
218215
echo "**This release is for development and testing purposes only!**" >> ${{github.workspace}}/Release.md
219216
if [ -f ${{github.workspace}}/Script/common.sh ]; then
220217
source ${{github.workspace}}/Script/common.sh
221-
222-
content=$(<${{github.workspace}}/ChangeLog.md)
223-
if [[ $content =~ ${{env.RabbitRemoteControl_VERSION}} ]]; then
218+
content=$(<"${{github.workspace}}/ChangeLog.md")
219+
if [[ $content =~ "${{env.RabbitRemoteControl_VERSION}}" ]]; then
224220
echo "## :us: Change log" >> ${{github.workspace}}/Release.md
225221
echo "" >> ${{github.workspace}}/Release.md
226222
get_section ${{github.workspace}}/ChangeLog.md >> ${{github.workspace}}/Release.md
227-
echo "" >> ${{github.workspace}}/Release.md
223+
echo "-------------------------" >> ${{github.workspace}}/Release.md
228224
fi
229225
fi
230-
echo "-------------------------" >> ${{github.workspace}}/Release.md
231226
echo "" >> ${{github.workspace}}/Release.md
232227
echo "Commit: [${{github.sha}}](https://github.com/KangLin/RabbitRemoteControl/commit/${{github.sha}})" >> ${{github.workspace}}/Release.md
233228
echo "" >> ${{github.workspace}}/Release.md

deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,13 @@ parse_with_getopts() {
347347
check_chang_log() {
348348
echo " - Modified change log ?"
349349
local content=$(<${SOURCE_DIR}/ChangeLog.md)
350-
if [[ $content =~ $VERSION ]]; then
350+
if [[ $content =~ "$VERSION" ]]; then
351351
echo_success " √ Modified in \"ChangeLog.md\""
352352
else
353353
echo_warn " ! Warning: Don't include \"$VERSION\" in the file \"ChangeLog.md\""
354354
fi
355355
content=$(<${SOURCE_DIR}/ChangeLog_zh_CN.md)
356-
if [[ $content =~ $VERSION ]]; then
356+
if [[ $content =~ "$VERSION" ]]; then
357357
echo_success " √ Modified in \"ChangeLog_zh_CN.md\""
358358
else
359359
echo_warn " ! Warning: Don't include \"$VERSION\" in the file \"ChangeLog_zh_CN.md\""

0 commit comments

Comments
 (0)