<commit_before>#!/bin/bash

MY_DIR=$(dirname $0)
RESOURCES="${MY_DIR}/resources"

[ $(tput colors) -ge 8 ] && {
  fg_green="$(tput setaf 2)"
  fg_bold="$(tput bold)"
  fg_white="$(tput setaf 7)"
  reset="$(tput sgr0)"
  function p {
    echo "${fg_white}${fg_bold}$@${fg_reset}"
  }
  function p2 {
  echo "${fg_green}$1${fg_reset}: "$(p $2)
  }
} || {
  function p {
    echo $@
  }
  function p {
    echo $1: $2
  }
}

p "Preparing environment: "

p2 Installing .inputrc
if [ ! -f $HOME/.inputrc ]; then
  cp "${RESOURCES}/inputrc" "$HOME/.inputrc"
else
  p "    Already exists, skipped."
fi

p2 Injecting .bash_profile
PROFILE_RESOURCE="$RESOURCES/bash_profile"
if [ -f ~/.bash_profile ] && grep -q $PROFILE_RESOURCE $HOME/.bash_profile; then
  p "    Already injected $PROFILE_RESOURCE"
else
  p "    source $PROFILE_RESOURCE >> ~/.bash_profile"
  echo "source $PROFILE_RESOURCE" >> ~/.bash_profile
fi

p2 Installing vimfiles
if [ -f ~/.vimrc ]; then
  p "    ~/.vimrc already present, skipping"
else
  if which vim >/dev/null; then
    if vim --version | head -n1 | grep -q 7.3; then
      pushd $HOME
      git clone http://github.com/xa4a/vimfiles .vim
      ln -s .vim/vimrc .vimrc
      popd
    else
      p "Vim 7.3 is required."
    fi
  else
    p "vim executable was not found in \$PATH"
  fi
fi<commit_msg>Init vim's vundle subrepo on checkout.<commit_after>#!/bin/bash

MY_DIR=$(dirname $0)
RESOURCES="${MY_DIR}/resources"

[ $(tput colors) -ge 8 ] && {
  fg_green="$(tput setaf 2)"
  fg_bold="$(tput bold)"
  fg_white="$(tput setaf 7)"
  reset="$(tput sgr0)"
  function p {
    echo "${fg_white}${fg_bold}$@${fg_reset}"
  }
  function p2 {
  echo "${fg_green}$1${fg_reset}: "$(p $2)
  }
} || {
  function p {
    echo $@
  }
  function p {
    echo $1: $2
  }
}

p "Preparing environment: "

p2 Installing .inputrc
if [ ! -f $HOME/.inputrc ]; then
  cp "${RESOURCES}/inputrc" "$HOME/.inputrc"
else
  p "    Already exists, skipped."
fi

p2 Injecting .bash_profile
PROFILE_RESOURCE="$RESOURCES/bash_profile"
if [ -f ~/.bash_profile ] && grep -q $PROFILE_RESOURCE $HOME/.bash_profile; then
  p "    Already injected $PROFILE_RESOURCE"
else
  p "    source $PROFILE_RESOURCE >> ~/.bash_profile"
  echo "source $PROFILE_RESOURCE" >> ~/.bash_profile
fi

p2 Installing vimfiles
if [ -f ~/.vimrc ]; then
  p "    ~/.vimrc already present, skipping"
else
  if which vim >/dev/null; then
    if vim --version | head -n1 | grep -q 7.3; then
      pushd $HOME
      git clone http://github.com/xa4a/vimfiles .vim
      ln -s .vim/vimrc .vimrc
      cd .vim
      git submodule update --init bundle/vundle
      popd
    else
      p "Vim 7.3 is required."
    fi
  else
    p "vim executable was not found in \$PATH"
  fi
fi
{'fraction_non_alphanumeric': 0.1545221530574881, 'fraction_numerical': 0.013914317099963384, 'mean_word_length': 2.8587570621468927, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '541823', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1026, 'n_words': 285}