Run shellcheck also for starter.sh

Fix typo
This commit is contained in:
2022-03-30 23:35:44 +02:00
parent 6b6fc3309e
commit 4e2c4cbf9b

View File

@@ -71,10 +71,11 @@ build::rdlink() {
return 1 return 1
fi fi
printf '# Building rdlink release\n' printf '# Building releases based on rdlink.sh\n'
build::headerRdlink "${rdlinkRelease}" build::headerRdlink "${rdlinkRelease}"
printf ' Extracting script part and removing debug information...' printf ' (Extracting script part and removing debug information)\n'
printf ' Building release/rdlink.sh...'
# Get essential script content # Get essential script content
# * extract script part # * extract script part
# * remove script marker # * remove script marker
@@ -93,7 +94,7 @@ build::rdlink() {
{ {
build::headerStarter "${starterRelease}" build::headerStarter "${starterRelease}"
printf ' Building starter...' printf ' Building release/starter.sh...'
if sed -n '/### Script.*/,/### Script Starter EOF/ p' < "${build_dir}/rdlink.sh" \ if sed -n '/### Script.*/,/### Script Starter EOF/ p' < "${build_dir}/rdlink.sh" \
| sed '/### Script.*/d; /^[[:blank:]]*info/d; /-d\{1,2\}/,/;;/d' \ | sed '/### Script.*/d; /^[[:blank:]]*info/d; /-d\{1,2\}/,/;;/d' \
| sed '/^$/N; /^\n$/D' \ | sed '/^$/N; /^\n$/D' \
@@ -108,19 +109,25 @@ build::rdlink() {
printf 'export _origin\n\n' >> "${starterRelease}" printf 'export _origin\n\n' >> "${starterRelease}"
printf '# Uncomment one of the next lines and replace "tostart.sh" with your script\n' >> "${starterRelease}" printf '# Uncomment one of the next lines and replace "tostart.sh" with your script\n' >> "${starterRelease}"
printf '# to have _origin available even on platform not supporting readlink -f.\n\n' >> "${starterRelease}" printf '# to have _origin available even on platforms not supporting readlink -f.\n\n' >> "${starterRelease}"
printf '#bash "${_origin}/tostart.sh"\n' >> "${starterRelease}" printf '#bash "${_origin}/tostart.sh"\n' >> "${starterRelease}"
printf '#. "${_origin}/tostart.sh"\n' >> "${starterRelease}" printf '#. "${_origin}/tostart.sh"\n' >> "${starterRelease}"
printf '#"${_origin}/tostart.sh"\n' >> "${starterRelease}" printf '#"${_origin}/tostart.sh"\n' >> "${starterRelease}"
} }
if [[ "${shellcheck_cmd}" ]] ; then if [[ "${shellcheck_cmd}" ]] ; then
printf '%b\n' " Running shellcheck...\033[1A\033[s\n" printf '%b\n' " Running shellcheck for rdlink...\033[1A\033[s\n"
if "${shellcheck_cmd}" "${rdlinkRelease}" ; then if "${shellcheck_cmd}" "${rdlinkRelease}" ; then
printf '%b' "\033[u${testresult_graphic}\n" printf '%b' "\033[u${testresult_graphic}\n"
else else
return 1 return 1
fi fi
printf '%b\n' " Running shellcheck for starter...\033[1A\033[s\n"
if "${shellcheck_cmd}" "${starterRelease}" ; then
printf '%b' "\033[u${testresult_graphic}\n"
else
return 1
fi
fi fi
chmod +x "${rdlinkRelease}" chmod +x "${rdlinkRelease}"
return 0 return 0