<commit_before>#!/bin/bash
############################
# .make.sh
#
### Tested with Ubuntu! So not recommended for other operating systems without prior check
### and change!
#
### Prior to running the first time I would recommend to save the Dotfiles before,
### just in case they get lost!
#
# This script sets up the Dotfiles environment from github.com/flyingdutchman23/Dotfiles.
# For that it checks whether the necessary software is available and installs it if
# needed.
# Then it installs the z shell and sets it as the default shell.
# After that it also saves the already existing Dotfiles in a directory specified by the variable
# olddir.
# Then this script creates symlinks from the home directory to any desired Dotfiles in the
# desired directory specified with the variable dir.
# Then it installs solarized. Information about that is available here:
# http://ethanschoonover.com/solarized/vim-colors-solarized
# It installs the powerline plug-in for vim and the z shell as well.
# At last it installs and updates all the vim plug-ins and recompiles YouCompleteMe if
# wanted.
#
# For the installation process the user can choose whether he wants to install certain
# parts system_wide or in the home folder.
# Currently the option is available for the powerline plug-in.
############################

########## Variables

#automatic quit, if error
set -e

cwd=`pwd`

# the name of the script
script=`basename $0`

# alternative home folder for installation
my_home=$HOME

# folder to install repos, which are not in the ubuntu packages
local_software=$my_home/local_software

# alternative home folder for installation
to_dots=$my_home

# dotfiles directory
dot_dir=$to_dots/Dotfiles

# old dotfiles backup directory
olddir=$to_dots/Dotfiles_old

# list of files/folders to symlink in homedir
files="bashrc vimrc gvimrc gitconfig shared_aliases zshrc inputrc shared_shell\
       dircolors-solarized antigen vim/ftplugin/* vim/syntax/* vim/ftdetect/*\
       env autocompletion_zsh config/zathura/zathurarc tmux.conf hgrc hgignore
       vim/autoload/*"

dirs="vim/autoload vim/ftplugin vim/plugin vim/syntax vim/ftdetect config/zathura"

# whether to install system wide or for user
approve_solarized_install=true
system_wide=false
installoption=""
changedefzsh=true

##########

#Help function
function HELP {
    echo -e \\n"Help documentation for ${script}"\\n
    echo "Installs the dotfiles of this git Dotfiles repository. You may need to
    give your passport to install needed sytem wide software packages, f.x. cmake"
    echo -e "Basic usage: ./$script "\\n
    echo -e "-d    specify parent dir of Dotfiles git repo. Dotfiles has to be
    in that dir.
    Folder needs to exist.
    Normally this folder is the home directory, f.x. .vimrc is normally stored
    in $my_home/.vimrc.
    Default value is $to_dots .
    Folder must not have a ending /"\\n
    echo -e "-i    gives an installoption, necessary option.
    Use either \"update\" or \"install\" as an argument." \\n
    echo -e "-s    Install some parts system wide. Default is $system_wide" \\n
    echo -e "-n    Do not set zsh as default shell" \\n
    echo -e "-o    Do not install solarized for gnome-terminal" \\n
    echo -e "-h    Displays this help message. No further functions are performed."\\n
    echo -e "Example for installation: $script -i install"\\n
    echo -e "Example for update: $script -i update"\\n
}

#check if bash is used
if [[ 0 == 0 ]];
then
    echo ""
else
    echo "You need to use bash to run this script!"
    exit 1
fi

while getopts ":d:i:s n h o" opt; do
    case $opt in
        d)
            if [ -d "$OPTARG" ];
            then
                if [[ -L "$OPTARG" ]];
                then
                    echo "specified directory is a link. EXIT!"
                    exit 1
                else
                    to_dots=$OPTARG
                fi
            else
                echo "specified directory does not exist. EXIT!"
                HELP;
                exit 1
            fi
            ;;
        i)
            if [ "$OPTARG" == "update" -o "$OPTARG" == "install" ];
            then
                installoption="$OPTARG"
            else
                echo "$OPTARG is not a valid argument. EXIT!"
                HELP;
                exit 1
            fi
            ;;
        s)
            system_wide=true
            ;;
        n)
            changedefzsh=false
            ;;
        o)
            approve_solarized_install=false<commit_msg>Remove unused feature.<commit_after>#!/bin/bash
############################
# .make.sh
#
### Tested with Ubuntu! So not recommended for other operating systems without prior check
### and change!
#
### Prior to running the first time I would recommend to save the Dotfiles before,
### just in case they get lost!
#
# This script sets up the Dotfiles environment from github.com/flyingdutchman23/Dotfiles.
# For that it checks whether the necessary software is available and installs it if
# needed.
# Then it installs the z shell and sets it as the default shell.
# After that it also saves the already existing Dotfiles in a directory specified by the variable
# olddir.
# Then this script creates symlinks from the home directory to any desired Dotfiles in the
# desired directory specified with the variable dir.
# Then it installs solarized. Information about that is available here:
# http://ethanschoonover.com/solarized/vim-colors-solarized
# It installs the powerline plug-in for vim and the z shell as well.
# At last it installs and updates all the vim plug-ins and recompiles YouCompleteMe if
# wanted.
#
# For the installation process the user can choose whether he wants to install certain
# parts system_wide or in the home folder.
# Currently the option is available for the powerline plug-in.
############################

########## Variables

#automatic quit, if error
set -e

cwd=`pwd`

# the name of the script
script=`basename $0`

# alternative home folder for installation
my_home=$HOME

# folder to install repos, which are not in the ubuntu packages
local_software=$my_home/local_software

# dotfiles directory
dot_dir=$my_home/Dotfiles

# old dotfiles backup directory
olddir=$my_home/Dotfiles_old

# list of files/folders to symlink in homedir
files="bashrc vimrc gvimrc gitconfig shared_aliases zshrc inputrc shared_shell\
       dircolors-solarized antigen vim/ftplugin/* vim/syntax/* vim/ftdetect/*\
       env autocompletion_zsh config/zathura/zathurarc tmux.conf hgrc hgignore
       vim/autoload/*"

dirs="vim/autoload vim/ftplugin vim/plugin vim/syntax vim/ftdetect config/zathura"

# whether to install system wide or for user
approve_solarized_install=true
system_wide=false
installoption=""
changedefzsh=true

##########

#Help function
function HELP {
    echo -e \\n"Help documentation for ${script}"\\n
    echo "Installs the dotfiles of this git Dotfiles repository. You may need to
    give your passport to install needed sytem wide software packages, f.x. cmake"
    echo -e "Basic usage: ./$script "\\n
    echo -e "-i    gives an installoption, necessary option.
    Use either \"update\" or \"install\" as an argument." \\n
    echo -e "-s    Install some parts system wide. Default is $system_wide" \\n
    echo -e "-n    Do not set zsh as default shell" \\n
    echo -e "-o    Do not install solarized for gnome-terminal" \\n
    echo -e "-h    Displays this help message. No further functions are performed."\\n
    echo -e "Example for installation: $script -i install"\\n
    echo -e "Example for update: $script -i update"\\n
}

#check if bash is used
if [[ 0 == 0 ]];
then
    echo ""
else
    echo "You need to use bash to run this script!"
    exit 1
fi

while getopts ":d:i:s n h o" opt; do
    case $opt in
        i)
            if [ "$OPTARG" == "update" -o "$OPTARG" == "install" ];
            then
                installoption="$OPTARG"
            else
                echo "$OPTARG is not a valid argument. EXIT!"
                HELP;
                exit 1
            fi
            ;;
        s)
            system_wide=true
            ;;
        n)
            changedefzsh=false
            ;;
        o)
            approve_solarized_install=false
{'fraction_non_alphanumeric': 0.09491443136302949, 'fraction_numerical': 0.0019419832503944654, 'mean_word_length': 2.6541019955654104, 'pattern_counts': {'":': 2, '<': 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': '41657', 'n_tokens_mistral': 2435, 'n_tokens_neox': 2321, 'n_words': 986}