#!/bin/bash

# SPDX-FileCopyrightText: 2020 Stefano Zacchiroli <zack@upsilon.cc>
# SPDX-License-Identifier: GPL-3.0-or-later

PG_SERVICE="gender-commit"
psql="psql service=${PG_SERVICE}"

$psql -f extract_totals.sql &> extract_totals.log

for entity in commit author ; do
    for period in utc-hour local-hour ; do
        src="/tmp/${entity}-gender-by-${period}.csv"
        if [ -f "$src" ] ; then
            cp "$src" .
        fi
    done
done
