#!/bin/zsh 

if [[ $# -eq 0 ]] ; then
    echo 'Please supply the filename you want to delete, as the first arg to this script.'
    echo ' e.g. "./deleteProductionIngestError.sh uuid-2344-kj8y-slkj-3lkj.csv"'
    exit -1
fi

awsume prod

set -eu



FILE=$1

echo "are you sure you want to delete $1?  (y/n)"

read AGREE

if [ $AGREE = "y" ]; then
  echo "deleting $FILE"
  echo $AGREE
else
  echo "ok, I will not delete $FILE"
fi


aws s3 rm s3://prod-neighbouring-rights/ownership/ingestion/processing/orchard/errors/${FILE}
