Skip to content

Commit 7a029f7

Browse files
committed
Fix p2 clean script
1 parent 3423404 commit 7a029f7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

net.sourceforge.pmd.eclipse.p2updatesite/cleanup-bintray-snapshots.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,17 @@ curl ${BASE_URL}/${CONTENT_FILE} > ${CONTENT_FILE}
4343

4444
# we keep some versions
4545
artifacts=$(grep "<child location" ${ARTIFACTS_FILE} | tail -${KEEP})
46-
count=$(grep "<child location" ${ARTIFACTS_FILE} | tail -${KEEP}|wc -l)
47-
artifacts_remove=$(grep "<child location" ${ARTIFACTS_FILE} | grep -v "${artifacts}")
48-
artifacts_remove_count=$(echo "${artifacts_remove}" | grep -c "<child location")
49-
5046
#echo "Artifacts to keep:"
5147
#echo "$artifacts"
48+
49+
count=$(grep "<child location" ${ARTIFACTS_FILE} | tail -${KEEP}|wc -l)
50+
echo "Total artifacts count: ${count}"
51+
52+
artifacts_remove=$(grep "<child location" ${ARTIFACTS_FILE} | grep -v "${artifacts}" || true)
5253
#echo "Artifacts to remove:"
5354
#echo "$artifacts_remove"
55+
56+
artifacts_remove_count=$(echo "${artifacts_remove}" | grep -c "<child location" || true)
5457
#echo "Artifacts to remove count: ${artifacts_remove_count}"
5558

5659
if [[ $artifacts_remove_count -eq 0 ]]; then

0 commit comments

Comments
 (0)