OSDN Git Service

[fix] : Use simple remove function
authorhayao <hayao@fascode.net>
Fri, 6 Aug 2021 16:43:57 +0000 (01:43 +0900)
committerhayao <hayao@fascode.net>
Fri, 6 Aug 2021 16:43:57 +0000 (01:43 +0900)
channels/releng/airootfs.any/root/customize_airootfs.sh

index 0e609ff..f75d926 100755 (executable)
@@ -55,20 +55,11 @@ kernel_filename="${kernel_config_line[1]}"
 kernel_mkinitcpio_profile="${kernel_config_line[2]}"
 
 
-# Delete file only if file exists
-# remove <file1> <file2> ...
-function remove () {
-    local _list
+# Show message when file is removed
+# remove <file> <file> ...
+remove() {
     local _file
-    _list=($(echo "$@"))
-    for _file in "${_list[@]}"; do
-        if [[ -f ${_file} ]]; then
-            rm -f "${_file}"
-        elif [[ -d ${_file} ]]; then
-            rm -rf "${_file}"
-        fi
-        echo "${_file} was deleted."
-    done
+    for _file in "${@}"; do echo "Removing ${_file}"; rm -rf "${_file}"; done
 }