Skip to content

Commit af7f455

Browse files
committed
[fix] : Fixed SC2086
1 parent a4853ef commit af7f455

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

build.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ umount_trap() {
253253
# load_config [file1] [file2] ...
254254
load_config() {
255255
local _file
256-
for _file in ${@}; do if [[ -f "${_file}" ]] ; then source "${_file}" && msg_debug "The settings have been overwritten by the ${_file}"; fi; done
256+
for _file in "${@}"; do if [[ -f "${_file}" ]] ; then source "${_file}" && msg_debug "The settings have been overwritten by the ${_file}"; fi; done
257257
}
258258

259259
# Display channel list
@@ -269,7 +269,7 @@ show_channel_list() {
269269
# for_module <command>
270270
for_module(){
271271
local module
272-
for module in ${modules[@]}; do eval $(echo ${@} | sed "s|{}|${module}|g"); done
272+
for module in "${modules[@]}"; do eval $(echo "${@}" | sed "s|{}|${module}|g"); done
273273
}
274274

275275
# パッケージをインストールする
@@ -282,7 +282,7 @@ _pacman(){
282282
# コマンドをchrootで実行する
283283
_chroot_run() {
284284
msg_debug "Run command in chroot\nCommand: ${*}"
285-
eval -- arch-chroot "${airootfs_dir}" ${@}
285+
eval -- arch-chroot "${airootfs_dir}" "${@}"
286286
}
287287

288288
_cleanup_common () {
@@ -326,7 +326,7 @@ _mkchecksum() {
326326
# Check the value of a variable that can only be set to true or false.
327327
check_bool() {
328328
local _value _variable
329-
for _variable in ${@}; do
329+
for _variable in "${@}"; do
330330
msg_debug -n "Checking ${_variable}..."
331331
eval ': ${'${_variable}':=""}'
332332
_value="$(eval echo '$'${_variable})"
@@ -347,7 +347,7 @@ prepare_env() {
347347
if [[ "${nodepend}" = false ]]; then
348348
local _check_failed=false _pkg _result=0
349349
msg_info "Checking dependencies ..."
350-
for _pkg in ${dependence[@]}; do
350+
for _pkg in "${dependence[@]}"; do
351351
eval "${tools_dir}/package.py" "${_pkg}" $( [[ "${debug}" = false ]] && echo "> /dev/null") || _result="${?}"
352352
case "${_result}" in
353353
"3")
@@ -627,7 +627,7 @@ make_customize_airootfs() {
627627
_airootfs_list=("${channel_dir}/airootfs.any" "${channel_dir}/airootfs.${arch}")
628628
for_module '_airootfs_list=("${module_dir}/{}/airootfs.any" "${module_dir}/{}/airootfs.${arch}" ${_airootfs_list[@]})'
629629

630-
for _airootfs in ${_airootfs_list[@]};do
630+
for _airootfs in "${_airootfs_list[@]}";do
631631
if [[ -d "${_airootfs}" ]]; then
632632
msg_debug "Copying airootfs ${_airootfs} ..."
633633
cp -af "${_airootfs}"/* "${airootfs_dir}"
@@ -676,7 +676,7 @@ make_customize_airootfs() {
676676
for_module '_script_list+=("${airootfs_dir}/root/customize_airootfs_{}.sh")'
677677

678678
# Create script
679-
for _script in ${_script_list[@]}; do
679+
for _script in "${_script_list[@]}"; do
680680
if [[ -f "${_script}" ]]; then
681681
echo -e "\n$(cat "${_script}")" >> "${airootfs_dir}/${_main_script}"
682682
remove "${_script}"
@@ -855,7 +855,7 @@ make_efi() {
855855
_efi_config_list+=($(ls "${script_path}/efiboot/${_use_config_name}/archiso-usb"*".conf" | grep -v "rescue"))
856856
fi
857857

858-
for _efi_config in ${_efi_config_list[@]}; do
858+
for _efi_config in "${_efi_config_list[@]}"; do
859859
sed "s|%ARCHISO_LABEL%|${iso_label}|g;
860860
s|%OS_NAME%|${os_name}|g;
861861
s|%KERNEL_FILENAME%|${kernel_filename}|g;
@@ -927,7 +927,7 @@ make_efiboot() {
927927
_efi_config_list+=($(ls "${script_path}/efiboot/${_use_config_name}/archiso-cd"*".conf" | grep -v "rescue"))
928928
fi
929929

930-
for _efi_config in ${_efi_config_list[@]}; do
930+
for _efi_config in "${_efi_config_list[@]}"; do
931931
sed "s|%ARCHISO_LABEL%|${iso_label}|g;
932932
s|%OS_NAME%|${os_name}|g;
933933
s|%KERNEL_FILENAME%|${kernel_filename}|g;
@@ -1036,7 +1036,7 @@ make_overisofs() {
10361036
local _over_isofs_list _isofs
10371037
_over_isofs_list=("${channel_dir}/over_isofs.any""${channel_dir}/over_isofs.${arch}")
10381038
for_module '_over_isofs_list+=("${module_dir}/{}/over_isofs.any""${module_dir}/{}/over_isofs.${arch}")'
1039-
for _isofs in ${_over_isofs_list[@]}; do
1039+
for _isofs in "${_over_isofs_list[@]}"; do
10401040
if [[ -d "${_isofs}" ]]; then cp -af "${_isofs}"/* "${isofs_dir}"; fi
10411041
done
10421042
}

0 commit comments

Comments
 (0)