From af50216007d9f548448afffd1efb469978bc6ecd Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Wed, 7 Jan 2015 10:52:45 -0800 Subject: [PATCH] Add a trap --- scripts/admin/copy-dev-bundle-from-jenkins.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/admin/copy-dev-bundle-from-jenkins.sh b/scripts/admin/copy-dev-bundle-from-jenkins.sh index e60b669e7f..90b89ba240 100755 --- a/scripts/admin/copy-dev-bundle-from-jenkins.sh +++ b/scripts/admin/copy-dev-bundle-from-jenkins.sh @@ -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?)"