OSDN Git Service

[fix] : Fixed an issue that rebuild cannot be used.
authorhayao <shun819.mail@gmail.com>
Wed, 29 Apr 2020 08:10:52 +0000 (17:10 +0900)
committerhayao <shun819.mail@gmail.com>
Wed, 29 Apr 2020 08:10:52 +0000 (17:10 +0900)
build.sh

index 066dec6..8b0a131 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -347,6 +347,13 @@ prepare_build() {
     [[ ! -d "${work_dir}" ]] && mkdir -p "${work_dir}"
 
 
+    # Check work dir
+    if [[ -n $(ls -a "${work_dir}" 2> /dev/null | grep -xv ".." | grep -xv ".") ]] && [[ ! "${rebuild}" = true ]]; then
+        _msg_info "Deleting the contents of ${work_dir}..."
+        remove "${work_dir%/}"/*
+    fi
+
+
     # Save build options
     local save_var
     save_var() {
@@ -488,13 +495,6 @@ prepare_build() {
     if [[ -z $(lsmod | awk '{print $1}' | grep -x "loop") ]]; then
         sudo modprobe loop
     fi
-
-    # Check work dir
-    if [[ -n $(ls -a "${work_dir}" 2> /dev/null | grep -xv ".." | grep -xv ".") ]] && [[ ! "${rebuild}" = true ]]; then
-        _msg_info "Deleting the contents of ${work_dir}..."
-        remove "${work_dir%/}"/*
-    fi
-
 }