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

#   Author: <NAME>
#   Description: Kind of unnecessary complicated script that attempts to
#                install the necessary dependencies, get and build Neovim
#                from the Git repo (github) and get the python and/or ruby libs
#
#   Usage:
#       $ get_nvim              # Leave all defaults,
#                               # - Doesn't clone (assume the repo is already cloned)
#                               # - Doesn't get libs or build deps,
#                               # - Installation dir is the current dir
#       $ get_nvim -d stuff_dir # Change the installation dir
#       $ get_nvim -c           # Clone the repo, leave everything else by default
#       $ get_nvim -p -r        # Get the python (-p) and ruby (-r) libs after install
#       $ get_nvim -b           # Get the build dependencies on some systems
#       $ get_nvim -h           # Show help, kind of
#
#                                     -`
#                     ...            .o+`
#                  .+++s+   .h`.    `ooo/
#                 `+++%++  .h+++   `+oooo:
#                 +++o+++ .hhs++. `+oooooo:
#                 +s%%so%.hohhoo'  'oooooo+:
#                 `+ooohs+h+sh++`/:  ++oooo+:
#                  hh+o+hoso+h+`/++++.+++++++:
#                   `+h+++h.+ `/++++++++++++++:
#                            `/+++ooooooooooooo/`
#                           ./ooosssso++osssssso+`
#                          .oossssso-````/osssss::`
#                         -osssssso.      :ssss``to.
#                        :osssssss/  Mike  osssl   +
#                       /ossssssss/   8a   +sssslb
#                     `/ossssso+/:-        -:/+ossss'.-
#                    `+sso+:-`                 `.-/+oso:
#                   `++:.                           `-/+/
#                   .`   github.com/mike325/dotfiles   `/

__NAME="$0"
__NAME="${__NAME##*/}"
__LOCATION="$(pwd)"
__URL="https://github.com/neovim/neovim"
__PYTHON_LIBS=0
__RUBY_LIBS=0
__BUILD_LIBS=0
__CLONE=0


# Warning ! This script delete everything in the work directory before install
function __show_nvim_libs() {
    echo "Please also consider to install the python libs"
    echo "  $ pip3 install --user neovim && pip2 install --user neovim"
    echo "and Ruby libs"
    echo "  $ gem install --user-install neovim"
    echo ""
}

function __show_nvim_help() {
    # echo "    ---- [X] Error Please make sure you have all the dependencies in your system"
    echo ""
    echo "Ubuntu/Debian/Linux mint"
    echo "  # apt-get install libtool libtool-bin autoconf automake cmake g++ pkg-config unzip"
    echo ""
    echo "CentOS/RetHat/Fedora"
    echo "  # dnf install libtool autoconf automake cmake gcc gcc-c++ make pkgconfig unzip"
    echo ""
    echo "ArchLinux/Antergos/Manjaro"
    echo "  # pacman -S base-devel cmake unzip"
    echo ""

    __show_nvim_libs

    echo "For other Unix systems (BSD, Linux and MacOS) and Windows please check"
    echo "  https://github.com/neovim/neovim/wiki/Building-Neovim"
}

function show_help() {
    echo ""
    echo "  Simple script to build and install Neovim directly from the source"
    echo "  with some pretty basic options."
    echo ""
    echo "  Usage:"
    echo "      $__NAME [OPTIONS]"
    echo ""
    echo "      Optional Flags"
    echo "          -c, --clone"
    echo "              By default this script expect to run under a git directory with"
    echo "              the Neovim's source code, this options clone Neovim's repo and move"
    echo "              to the repo's root before starts the compile process"
    echo ""
    echo "          -d <DIR> , --dir <DIR>"
    echo "              Choose the base root of the repo and move to it before compile"
    echo "              the source code, if this options is used with -c/--clone flag"
    echo "              it will clone the repo in the desire <DIR>"
    echo ""
    echo "          -p, --python"
    echo "              Install Neovim's python package for python2 and python3"
    echo ""
    echo "          -r, --ruby"
    echo "              Install Neovim's ruby package"
    echo ""
    echo "          -b, --build"
    echo "              Install all dependencies of the before build neovim's source code"
    echo "              Just few systems are supported, Debian's family, Fedora's family and"
    echo "              ArchLinux's family"
    echo ""
    echo "          -h, --help"
    echo "              Display help, if you are seeing this, that means that you already know it (nice)"
    echo ""

    # __show_nvim_help
}

function warn_msg() {
    WARN_MESSAGE="$1"
    printf "[!]     ---- Warning!!! %s \n" "$WARN_MESSAGE"
}

function error_msg() {
    ERROR_MESSAGE="$1"
    printf "[X]     ---- Error!!!   %s \n" "$ERROR_MESSAGE" 1>&2
}

function status_msg() {
    STATUS_MESSAGGE="$1"
    printf "[*]     ---- %s \n" "$STATUS_MESSAGGE"
}

while [[ $# -gt 0 ]]; do
    key="$1"
    case "$key" in
        -c|--clone)
            __CLONE=1
            ;;
        -d|--dir)
            __LOCATION="$2"
            shift
            ;;
        -p|--python)
            __PYTHON_LIBS=1
            ;;
        -r|--ruby)
            __RUBY_LIBS=1
            ;;
        -b|--build)
            __BUILD_LIBS=1
            ;;
        -h|--help)
            show_help
            exit 0
            ;;
    esac
    shift
done

if [[ "$__CLONE" -eq 1 ]]; then
    __LOCATION="$__LOCATION/neovim"

    git clone --recursive "$__URL" "$__LOCATION" || exit 1
fi

if [[ -d "$__LOCATION" ]]; then
    pushd "$__LOCATION" > /dev/null
else
    error_msg "$__LOCATION doesn't exist"
    exit 1
fi<commit_msg>Raise an error on windows platforms<commit_after>#!/usr/bin/env bash

#   Author: Mike 8a
#   Description: Kind of unnecessary complicated script that attempts to
#                install the necessary dependencies, get and build Neovim
#                from the Git repo (github) and get the python and/or ruby libs
#
#   Usage:
#       $ get_nvim              # Leave all defaults,
#                               # - Doesn't clone (assume the repo is already cloned)
#                               # - Doesn't get libs or build deps,
#                               # - Installation dir is the current dir
#       $ get_nvim -d stuff_dir # Change the installation dir
#       $ get_nvim -c           # Clone the repo, leave everything else by default
#       $ get_nvim -p -r        # Get the python (-p) and ruby (-r) libs after install
#       $ get_nvim -b           # Get the build dependencies on some systems
#       $ get_nvim -h           # Show help, kind of
#
#                                     -`
#                     ...            .o+`
#                  .+++s+   .h`.    `ooo/
#                 `+++%++  .h+++   `+oooo:
#                 +++o+++ .hhs++. `+oooooo:
#                 +s%%so%.hohhoo'  'oooooo+:
#                 `+ooohs+h+sh++`/:  ++oooo+:
#                  hh+o+hoso+h+`/++++.+++++++:
#                   `+h+++h.+ `/++++++++++++++:
#                            `/+++ooooooooooooo/`
#                           ./ooosssso++osssssso+`
#                          .oossssso-````/osssss::`
#                         -osssssso.      :ssss``to.
#                        :osssssss/  Mike  osssl   +
#                       /ossssssss/   8a   +sssslb
#                     `/ossssso+/:-        -:/+ossss'.-
#                    `+sso+:-`                 `.-/+oso:
#                   `++:.                           `-/+/
#                   .`   github.com/mike325/dotfiles   `/

__NAME="$0"
__NAME="${__NAME##*/}"
__LOCATION="$(pwd)"
__URL="https://github.com/neovim/neovim"
__PYTHON_LIBS=0
__RUBY_LIBS=0
__BUILD_LIBS=0
__CLONE=0


# Warning ! This script delete everything in the work directory before install
function __show_nvim_libs() {
    echo "Please also consider to install the python libs"
    echo "  $ pip3 install --user neovim && pip2 install --user neovim"
    echo "and Ruby libs"
    echo "  $ gem install --user-install neovim"
    echo ""
}

function __show_nvim_help() {
    # echo "    ---- [X] Error Please make sure you have all the dependencies in your system"
    echo ""
    echo "Ubuntu/Debian/Linux mint"
    echo "  # apt-get install libtool libtool-bin autoconf automake cmake g++ pkg-config unzip"
    echo ""
    echo "CentOS/RetHat/Fedora"
    echo "  # dnf install libtool autoconf automake cmake gcc gcc-c++ make pkgconfig unzip"
    echo ""
    echo "ArchLinux/Antergos/Manjaro"
    echo "  # pacman -S base-devel cmake unzip"
    echo ""

    __show_nvim_libs

    echo "For other Unix systems (BSD, Linux and MacOS) and Windows please check"
    echo "  https://github.com/neovim/neovim/wiki/Building-Neovim"
}

function show_help() {
    echo ""
    echo "  Simple script to build and install Neovim directly from the source"
    echo "  with some pretty basic options."
    echo ""
    echo "  Usage:"
    echo "      $__NAME [OPTIONS]"
    echo ""
    echo "      Optional Flags"
    echo "          -c, --clone"
    echo "              By default this script expect to run under a git directory with"
    echo "              the Neovim's source code, this options clone Neovim's repo and move"
    echo "              to the repo's root before starts the compile process"
    echo ""
    echo "          -d <DIR> , --dir <DIR>"
    echo "              Choose the base root of the repo and move to it before compile"
    echo "              the source code, if this options is used with -c/--clone flag"
    echo "              it will clone the repo in the desire <DIR>"
    echo ""
    echo "          -p, --python"
    echo "              Install Neovim's python package for python2 and python3"
    echo ""
    echo "          -r, --ruby"
    echo "              Install Neovim's ruby package"
    echo ""
    echo "          -b, --build"
    echo "              Install all dependencies of the before build neovim's source code"
    echo "              Just few systems are supported, Debian's family, Fedora's family and"
    echo "              ArchLinux's family"
    echo ""
    echo "          -h, --help"
    echo "              Display help, if you are seeing this, that means that you already know it (nice)"
    echo ""

    # __show_nvim_help
}

function warn_msg() {
    WARN_MESSAGE="$1"
    printf "[!]     ---- Warning!!! %s \n" "$WARN_MESSAGE"
}

function error_msg() {
    ERROR_MESSAGE="$1"
    printf "[X]     ---- Error!!!   %s \n" "$ERROR_MESSAGE" 1>&2
}

function status_msg() {
    STATUS_MESSAGGE="$1"
    printf "[*]     ---- %s \n" "$STATUS_MESSAGGE"
}

while [[ $# -gt 0 ]]; do
    key="$1"
    case "$key" in
        -c|--clone)
            __CLONE=1
            ;;
        -d|--dir)
            __LOCATION="$2"
            shift
            ;;
        -p|--python)
            __PYTHON_LIBS=1
            ;;
        -r|--ruby)
            __RUBY_LIBS=1
            ;;
        -b|--build)
            __BUILD_LIBS=1
            ;;
        -h|--help)
            show_help
            exit 0
            ;;
    esac
    shift
done

# Windows stuff
if [[ $(uname --all) =~ MINGW ]]; then
    __IS_WINDOWS=1
    warn_msg "Mingw platform is currently unsupported"
    error_msg "Please follow the official instructions to get Neovim in windows https://github.com/neovim/neovim/wiki/Installing-Neovim#windows"
    exit 1
fi

if [[ "$__CLONE" -eq 1 ]]; then
    __LOCATION="$__LOCATION/neovim"

    git clone --recursive "$__URL" "$__LOCATION" || exit 1
fi

if [[ -d "$__LOCATION" ]]; then
    pushd "$__LOCATION" > /dev/null
else
    error_msg "$__LOCATION doesn't exist"
    exit 1
fi
{'fraction_non_alphanumeric': 0.1241852487135506, 'fraction_numerical': 0.00523156089193825, 'mean_word_length': 1.5267605633802817, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 14, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1948021', 'n_tokens_mistral': 3768, 'n_tokens_neox': 3572, 'n_words': 1072}