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

title_sync() {
    doc_title << 'EOF'
     _______  ______  _____
    / ___/ / / / __ \/ ___/
   (__  ) /_/ / / / / /__
  /____/\__, /_/ /_/\___/
       /____/

EOF
}

command_sync() {
    title_sync
    ensure_filesystem
    ensure_dotfiles
    sync_home "${BACKUP_DIR}"
    if truth "${sync_root}"; then
        sudo_command sync_home "${ROOT_BACKUP_DIR}"
    fi
}

ensure_filesystem() {
    heading "Filesystem"

    ensure_dir "${config_dir}" "config dir"
    ensure_dir "${BACKUP_DIR}" "backup dir"
    truth "${sync_root}" && ensure_dir "${ROOT_BACKUP_DIR}" "root backup dir"
    echo
}

ensure_dotfiles() {
    [ -d "${config_dir}" ] || return 1;

    heading "Config repo"

    if [ ! -d "${DOTFILES_DIR}" ] && [ ! -z "${git_repo}" ]; then
        if ! clone_repo "${git_repo}" "${repo}"; then
            echo
            return 1
        fi
    fi
<commit_msg>display git repo in summary<commit_after>#!/usr/bin/env bash

title_sync() {
    doc_title << 'EOF'
     _______  ______  _____
    / ___/ / / / __ \/ ___/
   (__  ) /_/ / / / / /__
  /____/\__, /_/ /_/\___/
       /____/

EOF
}

command_sync() {
    title_sync
    ensure_filesystem
    ensure_dotfiles
    sync_home "${BACKUP_DIR}"
    if truth "${sync_root}"; then
        sudo_command sync_home "${ROOT_BACKUP_DIR}"
    fi
}

ensure_filesystem() {
    heading "Filesystem"

    ensure_dir "${config_dir}" "config dir"
    ensure_dir "${BACKUP_DIR}" "backup dir"
    truth "${sync_root}" && ensure_dir "${ROOT_BACKUP_DIR}" "root backup dir"
    echo
}

ensure_dotfiles() {
    [ -d "${config_dir}" ] || return 1;

    local HEADING="Config repo"
    if [ ! -z "${git_repo}" ]; then
        HEADING+=" (${git_repo})"
    fi
    heading "${HEADING}"

    if [ ! -d "${DOTFILES_DIR}" ] && [ ! -z "${git_repo}" ]; then
        if ! clone_repo "${git_repo}" "${repo}"; then
            echo
            return 1
        fi
    fi

{'fraction_non_alphanumeric': 0.16597724922440538, 'fraction_numerical': 0.002068252326783868, 'mean_word_length': 2.2142857142857144, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1314173', 'n_tokens_mistral': 710, 'n_tokens_neox': 687, 'n_words': 139}