<commit_before>#!/bin/bash

SSH="elec"

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
URL=http://milhouse.libreelec.tv/builds/master/RPi2/
VERSION=kodi.version

CURRENT=`cat $DIR/$VERSION`
NEXT=`curl -sf $URL | tail -2 | head -1 | sed 's/^.*href=\"\(.*\)\".*$/\1/'`

if [ $? != 0 ]; then
    echo "cannot access $URL"
    exit 1
fi
if [ "$CURRENT" != "$NEXT" ]; then
    ssh $SSH curl -# -o .update/$NEXT $URL$NEXT
    ssh $SSH '{ sleep 1; reboot; } > /dev/null &'
    echo $NEXT > $DIR/$VERSION
else
    echo "already up to date"
fi<commit_msg>replace absolute path with pushd/popd<commit_after>#!/bin/bash

SSH="elec"

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
URL=http://milhouse.libreelec.tv/builds/master/RPi2/
VERSION=kodi.version

pushd $DIR >&- 2>&-

CURRENT=`cat $VERSION`
NEXT=`curl -sf $URL | tail -2 | head -1 | sed 's/^.*href=\"\(.*\)\".*$/\1/'`

if [ $? != 0 ]; then
    echo "cannot access $URL"
    exit 1
fi
if [ "$CURRENT" != "$NEXT" ]; then
    ssh $SSH curl -# -o .update/$NEXT $URL$NEXT
    ssh $SSH '{ sleep 1; reboot; } > /dev/null &'
    echo $NEXT > $VERSION
else
    echo "already up to date"
fi

popd >&- 2>&-
{'fraction_non_alphanumeric': 0.23103448275862068, 'fraction_numerical': 0.015517241379310345, 'mean_word_length': 3.017301038062284, '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': '1403733', 'n_tokens_mistral': 503, 'n_tokens_neox': 462, 'n_words': 122}