<commit_before>#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

cd /home/pi/openaps-dev
git fetch --all
git reset --hard origin/master
git pull

#die() { echo "$@" 1>&2 ; exit 1; }
die() { echo "$@" ; exit 1; }

echo "Querying CGM"
openaps report invoke glucose.json || find glucose.json -mmin 10 || openaps report invoke glucose.json || die "Can't read from CGM"
git pull && git push
head -15 glucose.json

find *.json -mmin 15 -exec mv {} {}.old \;

# if it's been more than 3 minutes, unlock the CarelinkUSB
find /tmp/carelink.lock -mmin +3 -exec rm -f {} \; 2>/dev/null >/dev/null

# only one process can talk to the pump at a time
ls /tmp/carelink.lock >/dev/null 2>/dev/null && die "Carelink locked: exiting" && exit

echo "No lockfile: continuing"
touch /tmp/carelink.lock<commit_msg>make sure glucose.json has data<commit_after>#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

cd /home/pi/openaps-dev
git fetch --all && git reset --hard origin/master && git pull

#die() { echo "$@" 1>&2 ; exit 1; }
die() { echo "$@" ; exit 1; }

echo "Querying CGM"
openaps report invoke glucose.json || find glucose.json -mmin 10 && grep glucose glucose.json || openaps report invoke glucose.json || die "Can't read from CGM"
git pull && git push
head -15 glucose.json

find *.json -mmin 15 -exec mv {} {}.old \;

# if it's been more than 3 minutes, unlock the CarelinkUSB
find /tmp/carelink.lock -mmin +3 -exec rm -f {} \; 2>/dev/null >/dev/null

# only one process can talk to the pump at a time
ls /tmp/carelink.lock >/dev/null 2>/dev/null && die "Carelink locked: exiting" && exit

echo "No lockfile: continuing"
touch /tmp/carelink.lock
{'fraction_non_alphanumeric': 0.15811209439528023, 'fraction_numerical': 0.016519174041297935, 'mean_word_length': 3.4986737400530505, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '3650889', 'n_tokens_mistral': 658, 'n_tokens_neox': 582, 'n_words': 208}