<commit_before>#!/bin/sh

# Updates the crons using the cron definition file in this Repo
# Scripts/bash/cron/crontab.txt

. ~/Repos/Scripts/bash/common/common-utilities.sh

file="/Users/Albert/Repos/Scripts/backup/crontab.txt"

verifyFileExists $file

cd ~
crontab $file

file_size=$(du ~/Repos/Scripts/backup/crontab.txt | awk '{print $1}');

# If no crons, exit with message.
if [ "$file_size" == "0" ]; then
    echo "`tput setab 4` SUCCESS `tput setab 0` `tput setaf 3`$file`tput setaf 7` is empty so you currently have no crons."
    exit
fi

# If crons, exit and display crons.
OUTPUT=$(crontab -l ARG1 2>&1)
echo "`tput setab 4` SUCCESS `tput setab 0` Crons have been updated. Crontab is now configured to run the followning crons:`tput setaf 3`\n`crontab -l``tput setaf 7`"<commit_msg>Updated update-crontab script to use message function from common-utilities.<commit_after>#!/bin/sh

# Updates the crons using the cron definition file in this Repo
# Scripts/bash/cron/crontab.txt

. ~/Repos/Scripts/bash/common/common-utilities.sh

file="/Users/Albert/Repos/Scripts/backup/crontab.txt"

verifyFileExists $file

cd ~
crontab $file

file_size=$(du ~/Repos/Scripts/backup/crontab.txt | awk '{print $1}');

# If no crons, exit with message.
if [ "$file_size" == "0" ]; then
    message blue "CRONTAB UPDATED" "`tput setaf 3`$file`tput setaf 7` is empty so you currently have no crons."
    exit
fi

# If crons, exit and display crons.
OUTPUT=$(crontab -l ARG1 2>&1)
message blue "CRONTAB UPDATED" "Crontab is now configured to run the followning crons:`tput setaf 3`\n`crontab -l``tput setaf 7`"
{'fraction_non_alphanumeric': 0.12734082397003746, 'fraction_numerical': 0.01373283395755306, 'mean_word_length': 4.29042904290429, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7434302', 'n_tokens_mistral': 626, 'n_tokens_neox': 600, 'n_words': 183}