Tidying
This commit is contained in:
parent
1a3110b32c
commit
19ee1b87c3
|
@ -177,6 +177,15 @@ if [ ! $PASSWORD ]; then
|
|||
PASSWORD="$(openssl rand -base64 10 | cut -c1-8)"
|
||||
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
|
||||
rm $CURR_DIR/${PROJECT_NAME}*.sig
|
||||
|
@ -239,26 +248,14 @@ if [ ${#imgfiles[@]} -eq 0 ]; then
|
|||
exit 2
|
||||
fi
|
||||
|
||||
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
|
||||
# Move images to the current directory
|
||||
for im in "${image_types[@]}"
|
||||
do
|
||||
no_of_files=$(ls -afq build/${PROJECT_NAME}*.${im} | wc -l)
|
||||
if (( no_of_files > 0 )); then
|
||||
mv build/${PROJECT_NAME}*.${im} ${CURR_DIR}
|
||||
fi
|
||||
done
|
||||
|
||||
rm -rf ${BUILD_DIR}
|
||||
|
||||
|
|
Loading…
Reference in New Issue