<commit_before>#!/bin/bash

# Configuration ###############################################################

DOTFILES=(
    ".ncmpcpp"    "${HOME}/.ncmpcpp"
    ".tmux.conf"  "${HOME}/.tmux.conf"
    ".vim"        "${HOME}/.vim"
    ".vimrc"      "${HOME}/.vimrc"
    ".weechat"    "${HOME}/.weechat"
    ".Xresources" "${HOME}/.Xdefaults"
    ".Xresources" "${HOME}/.Xresources"
    ".xinitrc"    "${HOME}/.xinitrc"
    ".xmonad"     "${HOME}/.xmonad"
    ".zsh"        "${HOME}/.zsh"
    ".zshrc"      "${HOME}/.zshrc"
)

COLOR_CREATE="\033[1;32m"
COLOR_SKIP="\033[1;34m"
COLOR_DELETE="\033[1;35m"
COLOR_RESET="\033[0m"

# Script State ################################################################

script_name="`basename ${0}`"
script_dir="`cd "$(dirname "${0}")" && pwd`"

# Functions ###################################################################

install_dotfiles() {
    while (( $# )); do
        if [ ! -e "${2}" ]; then
            echo -e "${COLOR_CREATE}Creating link:${COLOR_RESET} ${2}"
            # ln -s "${script_dir}/${1}" "${2}"
        else
            echo -e "${COLOR_SKIP}Skipping link:${COLOR_RESET} ${2} (file exists)"
        fi

        shift 2
    done
}

clean_dotfiles() {
    while (( $# )); do
        # only remove symbolic links
        if [ -L "${2}" ]; then
            echo -e "${COLOR_DELETE}Removing link:${COLOR_RESET} ${2}"
            # rm -f "${2}"
        fi

        shift 2
    done
}

# Main Execution ##############################################################

case "${1}" in
    install )
        install_dotfiles "${DOTFILES[@]}"<commit_msg>Enable link creation and remove unused dotfiles from array<commit_after>#!/bin/bash

# Configuration ###############################################################

DOTFILES=(
    ".tmux.conf"  "${HOME}/.tmux.conf"
    ".vim"        "${HOME}/.vim"
    ".vimrc"      "${HOME}/.vimrc"
    ".weechat"    "${HOME}/.weechat"
    ".Xresources" "${HOME}/.Xdefaults"
    ".Xresources" "${HOME}/.Xresources"
    ".xmonad"     "${HOME}/.xmonad"
    ".zsh"        "${HOME}/.zsh"
    ".zshrc"      "${HOME}/.zshrc"
)

COLOR_CREATE="\033[1;32m"
COLOR_SKIP="\033[1;34m"
COLOR_DELETE="\033[1;35m"
COLOR_RESET="\033[0m"

# Script State ################################################################

script_name="`basename ${0}`"
script_dir="`cd "$(dirname "${0}")" && pwd`"

# Functions ###################################################################

install_dotfiles() {
    while (( $# )); do
        if [ ! -e "${2}" ]; then
            echo -e "${COLOR_CREATE}Creating link:${COLOR_RESET} ${2}"
            ln -s "${script_dir}/${1}" "${2}"
        else
            echo -e "${COLOR_SKIP}Skipping link:${COLOR_RESET} ${2} (file exists)"
        fi

        shift 2
    done
}

clean_dotfiles() {
    while (( $# )); do
        # only remove symbolic links
        if [ -L "${2}" ]; then
            echo -e "${COLOR_DELETE}Removing link:${COLOR_RESET} ${2}"
            rm -f "${2}"
        fi

        shift 2
    done
}

# Main Execution ##############################################################

case "${1}" in
    install )
        install_dotfiles "${DOTFILES[@]}"
{'fraction_non_alphanumeric': 0.3395275590551181, 'fraction_numerical': 0.02204724409448819, 'mean_word_length': 2.859052247873633, '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': '2790335', 'n_tokens_mistral': 1072, 'n_tokens_neox': 1021, 'n_words': 197}