<commit_before>#!/bin/bash

cd "${HOME}/.dotfiles"

# Pull down the latest changes
# git pull origin master

# Check out submodules
git submodule --quiet update --init

cd "${OLDPWD}"

function mirrorfiles() {
    # Copy .gitconfig
    # Any global git commands in ~/.extra will be written to .gitconfig
    # This prevents them being committed to the repository
    rsync -avz --quiet ${HOME}/.dotfiles/git/gitconfig  ${HOME}/.gitconfig

    # Symlink everything else
    # bash_profile sources other files from the repository
    # Force remove the vim directory if it is already there
    if [ -e "${HOME}/.vim" ]; then
        rm -rf "${HOME}/.vim"
    fi
    ln -fs ".dotfiles/osx"                "${HOME}/.osx"
    ln -fs ".dotfiles/bash/bashrc"        "${HOME}/.bashrc"
    ln -fs ".dotfiles/bash/bash_profile"  "${HOME}/.bash_profile"
    ln -fs ".dotfiles/bash/inputrc"       "${HOME}/.inputrc"
    ln -fs ".dotfiles/git/gitattributes"  "${HOME}/.gitattributes"
    ln -fs ".dotfiles/git/gitignore"      "${HOME}/.gitignore"
    ln -fs ".dotfiles/vim"                "${HOME}/.vim"
    ln -fs ".dotfiles/vim/gvimrc"         "${HOME}/.gvimrc"
    ln -fs ".dotfiles/vim/vimrc"          "${HOME}/.vimrc"

    echo "Dotfiles update complete"
}

read -p "This will overwrite some existing files in your home directory. Are you sure? (y/n) " -n 1
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
    mirrorfiles
    source ~/.bash_profile
fi
<commit_msg>Minor edit to installation script<commit_after>#!/bin/bash

cd "${HOME}/.dotfiles"

# Pull down the latest changes.
# git pull origin master

# Check out submodules.
git submodule --quiet update --init

cd "${OLDPWD}"

function link() {
    # Force create/replace the symlink.
    ln -fs "${HOME}/.dotfiles/${1}" "${HOME}/${2}"
}

function mirrorfiles() {
    # Copy `.gitconfig`.
    # Any global git commands in `~/.bash_profile.local` will be written to
    # `.gitconfig`. This prevents them being committed to the repository.
    rsync -avz --quiet ${HOME}/.dotfiles/git/gitconfig  ${HOME}/.gitconfig

    # Force remove the vim directory if it's already there.
    if [ -e "${HOME}/.vim" ]; then
        rm -rf "${HOME}/.vim"
    fi

    # Create the necessary symbolic links between the `.dotfiles` and `HOME`
    # directory. The `bash_profile` sources other files directly from the
    # `.dotfiles` repository.
    link "bash/bashrc"        ".bashrc"
    link "bash/bash_profile"  ".bash_profile"
    link "bash/inputrc"       ".inputrc"
    link "git/gitattributes"  ".gitattributes"
    link "git/gitignore"      ".gitignore"
    link "osx"                ".osx"
    link "vim"                ".vim"
    link "vim/gvimrc"         ".gvimrc"
    link "vim/vimrc"          ".vimrc"

    echo "Dotfiles update complete"
}

read -p "This will overwrite some existing files in your home directory. Are you sure? (y/n) " -n 1

echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
    mirrorfiles
    source ~/.bash_profile
fi

{'fraction_non_alphanumeric': 0.14324324324324325, 'fraction_numerical': 0.0013513513513513514, 'mean_word_length': 2.4958677685950414, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5341759', 'n_tokens_mistral': 1011, 'n_tokens_neox': 953, 'n_words': 305}