<commit_before>#!/bin/sh
# shellcheck disable=SC2039



# Delete a dot file.
# Updated 2019-06-27.
_koopa_delete_dotfile() {
    local path
    local name

    path="${HOME}/.${1}"
    name="$(basename "$path")"
    
    if [ -L "$path" ]
    then
        printf "Removing '%s'.\n" "$name"
        rm -f "$path"
    elif [ -f "$path" ] || [ -d "$path" ]
    then
        printf "Warning: Not symlink: %s\n" "$name"
    fi
}
<commit_msg>Add disk check<commit_after>#!/bin/sh
# shellcheck disable=SC2039



# Delete a dot file.
# Updated 2019-06-27.
_koopa_delete_dotfile() {
    local path
    local name

    path="${HOME}/.${1}"
    name="$(basename "$path")"
    
    if [ -L "$path" ]
    then
        printf "Removing '%s'.\n" "$name"
        rm -f "$path"
    elif [ -f "$path" ] || [ -d "$path" ]
    then
        printf "Warning: Not symlink: %s\n" "$name"
    fi
}



# Check that disk has enough free space.
# Updated 2019-08-15.
_koopa_disk_check() {
    local used
    local limit
    used="$(_koopa_disk_pct_used)"
    limit="80"
    if [ "$used" -gt "$limit" ]
    then
        >&2 printf "Warning: Disk usage is %d%%.\n" "$used"
    fi
}



# Check disk usage on main drive.
# Updated 2019-08-15.
_koopa_disk_pct_used() {
    local disk
    disk="${1:-/}"
    df -h "$disk" | \
        head -n 2  | \
        sed -n '2p' | \
        grep -Eo "([.0-9]+%)" | \
        sed 's/%$//'
}

{'fraction_non_alphanumeric': 0.18481375358166188, 'fraction_numerical': 0.03581661891117478, 'mean_word_length': 2.0107758620689653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '7461376', 'n_tokens_mistral': 579, 'n_tokens_neox': 529, 'n_words': 140}