Move if files exist

This commit is contained in:
Bob Mottram 2015-12-01 12:31:49 +00:00
parent a68443cc8c
commit 1a3110b32c
1 changed files with 21 additions and 5 deletions

View File

@ -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}