<commit_before>#! /bin/bash

if [[ $1 == -y ]]; then
  yes=true
fi

link_to_home() {
  echo "Linking $1 to $HOME/$1"
  if [[ $yes == true ]]; then
    ln -sf "$(pwd)/$1" "$HOME/$1"
  else
    ln -si "$(pwd)/$1" "$HOME/$1"
  fi
}

link_special() {
  echo "Linking $1 to $2"
  if [[ $yes == true ]]; then
    ln -sf "$(pwd)/$1" $2
  else
    ln -si "$(pwd)/$1" $2
  fi
}


# Link ZSH files
if type zsh &> /dev/null; then
  if [ ! -e "$HOME/.oh-my-zsh" ]; then
    echo "Installing oh-my-zsh"
    curl -L "https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh" | sh
  fi

  link_to_home .zshrc
  link_to_home .aliases
fi

# Link Tmux files
if type tmux &> /dev/null; then
  link_to_home .tmux.conf
fi

# Link Git files
if type git &> /dev/null; then
  echo "You should update the name and email in '.gitconfig'. Have you done this? "
  read input

  if [[ $input == y* ]]; then
    link_to_home .gitconfig
    link_to_home .gitignore_global
  elif [[ $input == n* ]]; then
    echo "Please do so and run this again"
  else
    echo "Answer was not recognized. Not linking '.gitconfig'"
  fi
fi

# Link Fish files and install oh-my-fish
if type fish &> /dev/null; then
  # Install oh-my-fish
  if [ ! -e "$HOME/.oh-my-fish" ]; then
    echo "Installing oh-my-fish"
    curl -L "https://github.com/oh-my-fish/oh-my-fish/raw/master/tools/install.fish" | fish
  fi

  # Link fish configs<commit_msg>Exit immeditately if user has not updated gitconfig<commit_after>#! /bin/bash

if [[ $1 == -y ]]; then
  yes=true
fi

link_to_home() {
  echo "Linking $1 to $HOME/$1"
  if [[ $yes == true ]]; then
    ln -sf "$(pwd)/$1" "$HOME/$1"
  else
    ln -si "$(pwd)/$1" "$HOME/$1"
  fi
}

link_special() {
  echo "Linking $1 to $2"
  if [[ $yes == true ]]; then
    ln -sf "$(pwd)/$1" $2
  else
    ln -si "$(pwd)/$1" $2
  fi
}


# Link ZSH files
if type zsh &> /dev/null; then
  if [ ! -e "$HOME/.oh-my-zsh" ]; then
    echo "Installing oh-my-zsh"
    curl -L "https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh" | sh
  fi

  link_to_home .zshrc
  link_to_home .aliases
fi

# Link Tmux files
if type tmux &> /dev/null; then
  link_to_home .tmux.conf
fi

# Link Git files
if type git &> /dev/null; then
  echo "You should update the name and email in '.gitconfig'. Have you done this? "
  read input

  if [[ $input == y* ]]; then
    link_to_home .gitconfig
    link_to_home .gitignore_global
  elif [[ $input == n* ]]; then
    echo "Please do so and run this again"
    exit
  else
    echo "Answer was not recognized. Not linking '.gitconfig'"
  fi
fi

# Link Fish files and install oh-my-fish
if type fish &> /dev/null; then
  # Install oh-my-fish
  if [ ! -e "$HOME/.oh-my-fish" ]; then
    echo "Installing oh-my-fish"
    curl -L "https://github.com/oh-my-fish/oh-my-fish/raw/master/tools/install.fish" | fish
  fi

  # Link fish configs
{'fraction_non_alphanumeric': 0.16206776108976598, 'fraction_numerical': 0.009081383164512749, 'mean_word_length': 2.620733249051833, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 4, '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': '1392999', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1132, 'n_words': 341}