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

# If last deployment occured during the last five minutes, abort
elapsed=$(deploy/elapsed_time.py "deploy/last_deploy.txt")
mintime=180
if [ ! "$elapsed" > "$mintime" ]
then
    echo "Time since last deployment: "$elapsed"s"
    echo "Not enough elapsed time. Aborting..."
    exit 0
fi

# Log new deploy
date '+%m/%d/%Y %H:%M:%S' > deploy/last_deploy.txt

# Pull from github
echo "Pulling from github..."
git pull
sleep 1

# Update publications
echo "Updating publications from zotero..."
rm -r content/publication
mkdir -p content/publication
deploy/fetch_zotero.py content/publication

# Compile website
echo "Compiling website with hugo..."
hugo

# Mount remote FTP, synchronize data and unmount
echo "Mounting spell.ulb.be FTP..."
source deploy/password.sh
mkdir -p spellftp
echo $password | sshfs <EMAIL>:/home/web1301/public_html spellftp -o password_stdin,allow_other
echo "Syncing files..."
rm -rf spellftp/*
cp -r public/* spellftp/
fusermount -u spell.ulb.be
echo "Done."<commit_msg>Update deploy.sh<commit_after>#!/usr/bin/env bash

# If last deployment occured during the last five minutes, abort
elapsed=$(deploy/elapsed_time.py "deploy/last_deploy.txt")
mintime=180
if [ ! "$elapsed" > "$mintime" ]
then
    echo "Time since last deployment: "$elapsed"s"
    echo "Not enough elapsed time. Aborting..."
    exit 0
fi

# Log new deploy
date '+%m/%d/%Y %H:%M:%S' > deploy/last_deploy.txt

# Pull from github
echo "Pulling from github..."
git pull
sleep 1

# Update publications
echo "Updating publications from zotero..."
rm -r content/publication
mkdir -p content/publication
deploy/fetch_zotero.py content/publication

# Compile website
echo "Compiling website with hugo..."
hugo

# Mount remote FTP, synchronize data and unmount
echo "Mounting spell.ulb.be FTP..."
source deploy/password.sh
mkdir -p spellftp
echo $password | sshfs <EMAIL>:/home/web1301/public_html spellftp -o password_stdin
echo "Syncing files..."
rm -rf spellftp/*
cp -r public/* spellftp/
fusermount -u spell.ulb.be
echo "Done."
{'fraction_non_alphanumeric': 0.12201073694485115, 'fraction_numerical': 0.008784773060029283, 'mean_word_length': 4.163727959697733, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1825062', 'n_tokens_mistral': 729, 'n_tokens_neox': 675, 'n_words': 226}