<commit_before>#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail
#set -o xtrace

SCRATCH_FILE="scratch/donorhistory_`date -u +%FT%TZ`.csv"
SFTP_BATCH_FILE=`cat <<EOF
cd FoundationDonors/
ls
put $SCRATCH_FILE
bye
EOF`

mkdir -p scratch
psql $DATABASE_URL -c "\copy (SELECT * FROM donor_history) TO '$SCRATCH_FILE' WITH DELIMITER AS ';' CSV HEADER FORCE QUOTE email, most_recent_donation_date"
echo "$BRICKFTP_PRIVATE_KEY" > scratch/brickftp_id_rsa
chmod 700 scratch/brickftp_id_rsa
echo "$SFTP_BATCH_FILE" > scratch/brickftp_batch
sftp -i scratch/brickftp_id_rsa -b scratch/brickftp_batch $<EMAIL>
rm -rf scratch

echo "The file has been uploaded successfully. You'll need to hit Ctrl-C to kill this process because of Heroku Spaces one-off dyno limitations"
<commit_msg>Don't use ':' in filename<commit_after>#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail
#set -o xtrace

SCRATCH_FILE="scratch/donorhistory_`date -u +%FT%H-%M-%SZ`.csv"
SFTP_BATCH_FILE=`cat <<EOF
cd FoundationDonors/
ls
put $SCRATCH_FILE
bye
EOF`

mkdir -p scratch
psql $DATABASE_URL -c "\copy (SELECT * FROM donor_history) TO '$SCRATCH_FILE' WITH DELIMITER AS ';' CSV HEADER FORCE QUOTE email, most_recent_donation_date"
echo "$BRICKFTP_PRIVATE_KEY" > scratch/brickftp_id_rsa
chmod 700 scratch/brickftp_id_rsa
echo "$SFTP_BATCH_FILE" > scratch/brickftp_batch
sftp -i scratch/brickftp_id_rsa -b scratch/brickftp_batch $<EMAIL>
rm -rf scratch

echo "The file has been uploaded successfully. You'll need to hit Ctrl-C to kill this process because of Heroku Spaces one-off dyno limitations"

{'fraction_non_alphanumeric': 0.09547738693467336, 'fraction_numerical': 0.0037688442211055275, 'mean_word_length': 5.397590361445783, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6056279', 'n_tokens_mistral': 642, 'n_tokens_neox': 598, 'n_words': 179}