This commit is contained in:
Bob Mottram 2015-12-01 14:13:23 +00:00
parent 1a3110b32c
commit 19ee1b87c3
1 changed files with 17 additions and 20 deletions

View File

@ -177,6 +177,15 @@ if [ ! $PASSWORD ]; then
PASSWORD="$(openssl rand -base64 10 | cut -c1-8)" PASSWORD="$(openssl rand -base64 10 | cut -c1-8)"
fi fi
image_types=( bz2 img sig vdi qcow2 )
for im in "${image_types[@]}"
do
no_of_files=$(ls -afq ${CURR_DIR}/${PROJECT_NAME}*.${im} | wc -l)
if (( no_of_files > 0 )); then
rm ${CURR_DIR}/${PROJECT_NAME}*.${im}
fi
done
rm $CURR_DIR/${PROJECT_NAME}*.img.bz2 rm $CURR_DIR/${PROJECT_NAME}*.img.bz2
rm $CURR_DIR/${PROJECT_NAME}*.img rm $CURR_DIR/${PROJECT_NAME}*.img
rm $CURR_DIR/${PROJECT_NAME}*.sig rm $CURR_DIR/${PROJECT_NAME}*.sig
@ -239,26 +248,14 @@ if [ ${#imgfiles[@]} -eq 0 ]; then
exit 2 exit 2
fi fi
no_of_files=$(ls -afq build/${PROJECT_NAME}*.bz2 | wc -l) # Move images to the current directory
if (( no_of_files > 0 )); then for im in "${image_types[@]}"
mv build/${PROJECT_NAME}*.bz2 ${CURR_DIR} do
fi no_of_files=$(ls -afq build/${PROJECT_NAME}*.${im} | wc -l)
no_of_files=$(ls -afq build/${PROJECT_NAME}*.img | wc -l) if (( no_of_files > 0 )); then
if (( no_of_files > 0 )); then mv build/${PROJECT_NAME}*.${im} ${CURR_DIR}
mv build/${PROJECT_NAME}*.img ${CURR_DIR} fi
fi done
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} rm -rf ${BUILD_DIR}