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

die() { echo "$@" ; exit 1; }

# only one process can talk to the pump at a time
ls /tmp/openaps.lock >/dev/null 2>/dev/null && die "OpenAPS already running: exiting" && exit

echo "No lockfile: continuing"
touch /tmp/openaps.lock
/home/pi/decocare/insert.sh 2>/dev/null >/dev/null

function finish {
    rm /tmp/openaps.lock
}
trap finish EXIT

cd /home/pi/openaps-dev
git fetch --all && ( git merge || git reset --hard origin/master ) && git pull
#git fetch origin master && ( git merge -X theirs origin/master || git reset --hard origin/master )


echo "Querying CGM"
openaps report invoke glucose.json.new || openaps report invoke glucose.json.new 
grep glucose glucose.json.new && cp glucose.json.new glucose.json && git commit -m"glucose.json has glucose data: committing" glucose.json<commit_msg>git merge keeps getting killed: let's try git pull --ff-only<commit_after>#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

die() { echo "$@" ; exit 1; }

# only one process can talk to the pump at a time
ls /tmp/openaps.lock >/dev/null 2>/dev/null && die "OpenAPS already running: exiting" && exit

echo "No lockfile: continuing"
touch /tmp/openaps.lock
/home/pi/decocare/insert.sh 2>/dev/null >/dev/null

function finish {
    rm /tmp/openaps.lock
}
trap finish EXIT

cd /home/pi/openaps-dev
git fetch --all && ( git pull --ff-only || git reset --hard origin/master )
#git fetch origin master && ( git merge -X theirs origin/master || git reset --hard origin/master )


echo "Querying CGM"
openaps report invoke glucose.json.new || openaps report invoke glucose.json.new 
grep glucose glucose.json.new && cp glucose.json.new glucose.json && git commit -m"glucose.json has glucose data: committing" glucose.json
{'fraction_non_alphanumeric': 0.14036996735582155, 'fraction_numerical': 0.003264417845484222, 'mean_word_length': 3.7153846153846155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4640930', 'n_tokens_mistral': 667, 'n_tokens_neox': 595, 'n_words': 195}