diff --git a/src/freedombone-image b/src/freedombone-image index 088ac780..9b5bfbab 100755 --- a/src/freedombone-image +++ b/src/freedombone-image @@ -239,11 +239,27 @@ if [ ${#imgfiles[@]} -eq 0 ]; then exit 2 fi -mv build/${PROJECT_NAME}*.bz2 ${CURR_DIR} -mv build/${PROJECT_NAME}*.img ${CURR_DIR} -mv build/${PROJECT_NAME}*.sig ${CURR_DIR} -mv build/${PROJECT_NAME}*.vdi ${CURR_DIR} -mv build/${PROJECT_NAME}*.qcow2 ${CURR_DIR} +no_of_files=$(ls -afq build/${PROJECT_NAME}*.bz2 | wc -l) +if (( no_of_files > 0 )); then + mv build/${PROJECT_NAME}*.bz2 ${CURR_DIR} +fi +no_of_files=$(ls -afq build/${PROJECT_NAME}*.img | wc -l) +if (( no_of_files > 0 )); then + mv build/${PROJECT_NAME}*.img ${CURR_DIR} +fi +no_of_files=$(ls -afq build/${PROJECT_NAME}*.sig | wc -l) +if (( no_of_files > 0 )); then + mv build/${PROJECT_NAME}*.sig ${CURR_DIR} +fi +no_of_files=$(ls -afq build/${PROJECT_NAME}*.vdi | wc -l) +if (( no_of_files > 0 )); then + mv build/${PROJECT_NAME}*.vdi ${CURR_DIR} +fi +no_of_files=$(ls -afq build/${PROJECT_NAME}*.qcow2 | wc -l) +if (( no_of_files > 0 )); then + mv build/${PROJECT_NAME}*.qcow2 ${CURR_DIR} +fi + rm -rf ${BUILD_DIR} cd ${CURR_DIR}