Add a trap

This commit is contained in:
Slava Kim
2015-01-07 10:52:45 -08:00
committed by Sashko Stubailo
parent ef60dbaccd
commit af50216007

View File

@@ -33,10 +33,13 @@ fi
echo Found build $DIRNAME
trap "echo Found surprising number of tarballs." EXIT
# Check to make sure the proper number of each kind of file is there.
s3cmd ls s3://com.meteor.jenkins/$DIRNAME/ | \
perl -nle 'if (/\.tar\.gz/) { ++$TAR } else { die "something weird" } END { exit !($TAR == 4) }'
trap - EXIT
for FILE in $(s3cmd ls s3://com.meteor.jenkins/$DIRNAME/ | perl -nlaF/ -e 'print $F[-1]'); do
if s3cmd info $TARGET$FILE >/dev/null 2>&1; then
echo "$TARGET$FILE already exists (maybe from another branch?)"