#!/bin/zsh

#assumes you have a prod section in ~/.aws/credentials, and awsume of course


awsume prod

set -eu

if [[ $# -eq 0 ]] ; then
    echo 'Please supply a file UUID, which is the automatically generated uploaded file name, minus the ".csv" suffix'
    echo ' e.g. "./downloadErrorAndOrigForSYnc.sh uuid-2344-kj8y-slkj-3lkj"'
    exit -1
fi

FILE=$1

aws s3 cp s3://prod-neighbouring-rights/ownership/ingestion/uploads/orchard/${FILE}.csv .

aws s3 cp s3://prod-neighbouring-rights/ownership/ingestion/processing/orchard/errors/${FILE}_errors.csv .
