<commit_before>#!/bin/bash

set -e
# setting colors
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
GRAY="$(tput setaf 7)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"

main() {
    # clonnig repositories
    printf "${BOLD}"
    echo 'Clonning Respository...'
    printf "${NORMAL}${GRAY}"
    mkdir ~/.dotfiles
    git clone https://github.com/aflavio/another-dotfiles.git .dotfiles
    cd .dotfiles
    git submodule update --init --recursive 
    cd ..
    #echo 'done.'
    DOTFILES=$HOME/.dotfiles
    printf "${NORMAL}"

    # creating symlinks
    printf "${BOLD}"
    echo -e '\nCreating symlinks...'
    ln -s $DOTFILES/vim .vim
    linkables=$( find -H "$DOTFILES" -name '*.symlink' )
    
    for file in $linkables ; do
        target="$HOME/.$( basename $file ".symlink" )"
        ln -s $file $target
    done

    # linking font files
    ls -s $DOTFILES/fonts .fonts
    source $HOME/.zshrc

    echo 'done.'
    printf "${NORMAL}"

    # installing vim plugins
    printf "${BOLD}"
    echo -e '\nNow, all Vim Plugins will be installed. This can will take a while...'
    echo 'If it`s fail, please run manually the follow command on shell:'
    printf "${RED}vim +PlugInstall${NORMAL}${BOLD}"
    echo -e '\nPress any key to continue'
    #read flag
    vim +PlugInstall +qall
    echo 'done.'
    printf "${NORMAL}"

    # copyng init.d script files
    ln -s $DOTFILES/scripts/init.d/reset-ethernet.sh /etc/init.d/reset-ethernet.sh 

}

splash() {
    printf "${BLUE}" 
    echo '██      ▄   ████▄    ▄▄▄▄▀ ▄  █ ▄███▄   █▄▄▄▄          '
    echo '█ █      █  █   █ ▀▀▀ █   █   █ █▀   ▀  █  ▄▀          '
    echo '█▄▄█ ██   █ █   █     █   ██▀▀█ ██▄▄    █▀▀▌           '
    echo '█  █ █ █  █ ▀████    █    █   █ █▄   ▄▀ █  █           '
    echo '   █ █  █ █         ▀        █  ▀███▀     █            '
    echo '  █  █   ██                 ▀            ▀             '
    echo ' ▀                                                     '
    echo '██▄   ████▄    ▄▄▄▄▀ ▄████  ▄█ █     ▄███▄     ▄▄▄▄▄   '
    echo '█  █  █   █ ▀▀▀ █    █▀   ▀ ██ █     █▀   ▀   █     ▀▄ '
    echo '█   █ █   █     █    █▀▀    ██ █     ██▄▄   ▄  ▀▀▀▀▄   '
    echo '█  █  ▀████    █     █      ▐█ ███▄  █▄   ▄▀ ▀▄▄▄▄▀    '<commit_msg>fixing isntallation<commit_after>#!/bin/bash

set -e
# setting colors
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
GRAY="$(tput setaf 7)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"

checkDirectories() {
    local_dirs=("$@")

    for (( i = 0 ; i < ${#local_dirs[@]} ; i++ ))
        do
            if [ ! -d "$i" ]; then
                mkdir ${local_dirs[$i]}
            fi
    done
}

main() {
    # vars
    DOTFILES=$HOME/.dotfiles

    # create directories
    directories=(".dotfiles")

    # checking directories
    echo "${BOLD}Checking Directories..."
    checkDirectories "${directories[@]}" 

    # clonnig repositories
    echo "${BOLD}Clonning Respository..."
    printf "${NORMAL}${GRAY}"

    git clone https://github.com/aflavio/another-dotfiles.git .dotfiles

    cd .dotfiles
    git submodule update --init --recursive
    cd ..
    echo "done."

    # creating symlinks
    printf ""
    echo -e "${BOLD}Creating symlinks..."

    ln -s $DOTFILES/vim ~/.vim
    linkables=$( find -H "$DOTFILES" -name '*.symlink' )

    for file in $linkables ; do
        target="$HOME/.$( basename $file ".symlink" )"
        ln -s $file $target
    done

    # linking font files
    ls -s $DOTFILES/fonts .fonts
    source $HOME/.zshrc

    echo 'done.'
    printf "${NORMAL}"

    # installing vim plugins
    printf "${BOLD}"
    echo -e '\nNow, all Vim Plugins will be installed. This can will take a while...'
    echo 'If it`s fail, please run manually the follow command on shell:'
    printf "${RED}vim +PlugInstall${NORMAL}${BOLD}"
    echo -e '\nPress any key to continue'
    #read flag
    vim +PlugInstall +qall
    echo 'done.'
    printf "${NORMAL}"

    # copyng init.d script files
    ln -s $DOTFILES/scripts/init.d/reset-ethernet.sh /etc/init.d/reset-ethernet.sh

}

splash() {
    printf "${BLUE}"
    echo '██      ▄   ████▄    ▄▄▄▄▀ ▄  █ ▄███▄   █▄▄▄▄          '
    echo '█ █      █  █   █ ▀▀▀ █   █   █ █▀   ▀  █  ▄▀          '
    echo '█▄▄█ ██   █ █   █     █   ██▀▀█ ██▄▄    █▀▀▌           '
    echo '█  █ █ █  █ ▀████    █    █   █ █▄   ▄▀ █  █           '
    echo '   █ █  █ █         ▀        █  ▀███▀     █            '
    echo '  █  █   ██                 ▀            ▀             '
    echo ' ▀                                                     '
    echo '██▄   ████▄    ▄▄▄▄▀ ▄████  ▄█ █     ▄███▄     ▄▄▄▄▄   '
    echo '█  █  █   █ ▀▀▀ █    █▀   ▀ ██ █     █▀   ▀   █     ▀▄ '
    echo '█   █ █   █     █    █▀▀    ██ █     ██▄▄   ▄  ▀▀▀▀▄   '
    echo '█  █  ▀████    █     █      ▐█ ███▄  █▄   ▄▀ ▀▄▄▄▄▀    '
{'fraction_non_alphanumeric': 0.20049556060293205, 'fraction_numerical': 0.0022713194301053068, 'mean_word_length': 1.5535055350553506, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5844646', 'n_tokens_mistral': 1931, 'n_tokens_neox': 1962, 'n_words': 558}