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

set -e
set -u

function puts () {
  echo "\n-- [$1] $2"
}

if ! [[ -d $HOME/.cache/ssh/sockets ]]; then
  mkdir -p $HOME/.cache/ssh/sockets
  puts 'Created' '~/.cache/ssh/sockets'
fi

if ! [[ -e $HOME/.gemrc ]]; then
  echo 'gem: --no-document' > $HOME/.gemrc
  puts 'Created' '~/.gemrc'
fi

if ! [[ -d $HOME/.zgen.zsh ]]; then
  puts 'Installing' 'zshrc'
  curl -L https://rc.evansosenko.com/zshrc/install.sh | sh
fi

if [[ -d $HOME/.zgen.zsh ]]; then
  puts 'Installed' 'zshrc'
fi

if ! [[ -d $HOME/.rbenv ]]; then
  puts 'Installing' 'rbenv'
  git clone https://github.com/sstephenson/rbenv.git $HOME/.rbenv
  cp -p dotfiles/rbenv/default-gems $HOME/.rbenv
  cd $HOME/.rbenv
  git checkout $(git describe --abbrev=0 --tags)
  src/configure
  make -C src
fi

if [[ -d $HOME/.rbenv ]]; then
  puts 'Installed' 'rbenv'
fi

if ! [[ -d $HOME/.rbenv/plugins/ruby-build ]]; then
  puts 'Installing' 'ruby-build'
  git clone https://github.com/sstephenson/ruby-build.git \
    $HOME/.rbenv/plugins/ruby-build
  cd $HOME/.rbenv/plugins/ruby-build
  git checkout $(git describe --abbrev=0 --tags)
fi

if [[ -d $HOME/.rbenv/plugins/ruby-build ]]; then
  puts 'Installed' 'ruby-build'
fi

if ! [[ -d $HOME/.rbenv/plugins/rbenv-gem-rehash ]]; then
  puts 'Installing' 'rbenv-gem-rehash'
  git clone https://github.com/sstephenson/rbenv-gem-rehash.git \
    $HOME/.rbenv/plugins/rbenv-gem-rehash
fi

if [[ -d $HOME/.rbenv/plugins/rbenv-gem-rehash ]]; then
  puts 'Installed' 'rbenv-gem-rehash'
fi

if ! [[ -d $HOME/.rbenv/plugins/rbenv-default-gems ]]; then
  puts 'Installing' 'rbenv-default-gems'
  git clone https://github.com/sstephenson/rbenv-default-gems.git \
    $HOME/.rbenv/plugins/rbenv-default-gems
fi

if [[ -d $HOME/.rbenv/plugins/rbenv-default-gems ]]; then
  puts 'Installed' 'rbenv-default-gems'
fi

if ! [[ -d $HOME/.rbenv/plugins/rbenv-ctags ]]; then
  puts 'Installing' 'rbenv-ctags'
  git clone https://github.com/tpope/rbenv-ctags.git \
    $HOME/.rbenv/plugins/rbenv-ctags
fi

if [[ -d $HOME/.rbenv/plugins/rbenv-ctags ]]; then
  puts 'Installed' 'rbenv-default-ctags'
fi

if ! [[ -d $HOME/.rbenv/plugins/rbenv-bundler ]]; then
  puts 'Installing' 'rbenv-bundler'
  git clone https://github.com/carsomyr/rbenv-bundler.git \
    $HOME/.rbenv/plugins/rbenv-bundler
  cd $HOME/.rbenv/plugins/rbenv-bundler
  git checkout $(git describe --abbrev=0 --tags)
  $HOME/.rbenv/bin/rbenv bundler on
fi

if [[ -d $HOME/.rbenv/plugins/rbenv-bundler ]]; then
  puts 'Installed' 'rbenv-bundler'
fi

if ! [[ -d $HOME/.pyenv ]]; then
  puts 'Installing' 'pyenv'
  git clone https://github.com/yyuu/pyenv.git $HOME/.pyenv
  cd $HOME/.pyenv
  git checkout $(git describe --abbrev=0 --tags)
fi

if [[ -d $HOME/.pyenv ]]; then
  puts 'Installed' 'pyenv'
fi

if ! [[ -d $HOME/.pyenv/plugins/pyenv-virtualenv ]]; then
  puts 'Installing' 'pyenv-virtualenv'
  git clone https://github.com/yyuu/pyenv-virtualenv.git \
    $HOME/.pyenv/plugins/pyenv-virtualenv
  cd $HOME/.pyenv/plugins/pyenv-virtualenv
  git checkout $(git describe --abbrev=0 --tags)
fi

if [[ -d $HOME/.pyenv/plugins/pyenv-virtualenv ]]; then
  puts 'Installed' 'pyenv-virtualenv'
fi

if ! [[ -d $HOME/.nvm ]]; then
  puts 'Installing' 'nvm'
  git clone https://github.com/creationix/nvm.git $HOME/.nvm
  cd $HOME/.nvm
  git checkout $(git describe --abbrev=0 --tags)
fi

if [[ -d $HOME/.nvm ]]; then
  puts 'Installed' 'nvm'
fi

if ! [[ -h $HOME/.local/share/nvim/site/spell ]]; then
  mkdir -p $HOME/.local/share/nvim/site
  if [[ -d /usr/share/vim/vimfiles/spell ]]; then
    ln -s /usr/share/vim/vimfiles/spell $HOME/.local/share/nvim/site
  fi
fi

if ! [[ -d $HOME/.config/nvim/plugged/nvimrc ]]; then
  puts 'Installing' 'nvimrc'
  curl -L https://rc.evansosenko.com/nvimrc/install.sh | sh
fi

if [[ -d $HOME/.config/nvim/plugged/nvimrc ]]; then
  puts 'Installed' 'nvimrc'
fi

if ! [[ -d $HOME/.tmux/plugins/tmuxrc ]]; then
  if [[ ! -z "${TMUX:-}" ]]; then
    puts 'Installing' 'tmuxrc'
    curl -L https://rc.evansosenko.com/tmuxrc/install.sh | sh
    puts 'Installed' 'tmux plugins'
  else
    puts 'Info' 'Run in a tmux session to install tmuxrc.'
  fi
fi

if [[ -d $HOME/.tmux/plugins/tmuxrc ]]; then
  puts 'Installed' 'tmuxrc'
fi

if ! [[ -e $HOME/.promptline.sh ]]; then
  if [[ -d $HOME/.config/nvim/plugged/promptline.vim ]]; then
    puts 'Installing' 'promptline'
    nvim -c "PromptlineSnapshot ~/.promptline.sh" -c qall!
  fi
fi

if [[ -e $HOME/.promptline.sh ]]; then
  puts 'Installed' 'promptline'<commit_msg>Update promptline path<commit_after>#!/usr/bin/env zsh

set -e
set -u

function puts () {
  echo "\n-- [$1] $2"
}

if ! [[ -d $HOME/.cache/ssh/sockets ]]; then
  mkdir -p $HOME/.cache/ssh/sockets
  puts 'Created' '~/.cache/ssh/sockets'
fi

if ! [[ -e $HOME/.gemrc ]]; then
  echo 'gem: --no-document' > $HOME/.gemrc
  puts 'Created' '~/.gemrc'
fi

if ! [[ -d $HOME/.zgen.zsh ]]; then
  puts 'Installing' 'zshrc'
  curl -L https://rc.evansosenko.com/zshrc/install.sh | sh
fi

if [[ -d $HOME/.zgen.zsh ]]; then
  puts 'Installed' 'zshrc'
fi

if ! [[ -d $HOME/.rbenv ]]; then
  puts 'Installing' 'rbenv'
  git clone https://github.com/sstephenson/rbenv.git $HOME/.rbenv
  cp -p dotfiles/rbenv/default-gems $HOME/.rbenv
  cd $HOME/.rbenv
  git checkout $(git describe --abbrev=0 --tags)
  src/configure
  make -C src
fi

if [[ -d $HOME/.rbenv ]]; then
  puts 'Installed' 'rbenv'
fi

if ! [[ -d $HOME/.rbenv/plugins/ruby-build ]]; then
  puts 'Installing' 'ruby-build'
  git clone https://github.com/sstephenson/ruby-build.git \
    $HOME/.rbenv/plugins/ruby-build
  cd $HOME/.rbenv/plugins/ruby-build
  git checkout $(git describe --abbrev=0 --tags)
fi

if [[ -d $HOME/.rbenv/plugins/ruby-build ]]; then
  puts 'Installed' 'ruby-build'
fi

if ! [[ -d $HOME/.rbenv/plugins/rbenv-gem-rehash ]]; then
  puts 'Installing' 'rbenv-gem-rehash'
  git clone https://github.com/sstephenson/rbenv-gem-rehash.git \
    $HOME/.rbenv/plugins/rbenv-gem-rehash
fi

if [[ -d $HOME/.rbenv/plugins/rbenv-gem-rehash ]]; then
  puts 'Installed' 'rbenv-gem-rehash'
fi

if ! [[ -d $HOME/.rbenv/plugins/rbenv-default-gems ]]; then
  puts 'Installing' 'rbenv-default-gems'
  git clone https://github.com/sstephenson/rbenv-default-gems.git \
    $HOME/.rbenv/plugins/rbenv-default-gems
fi

if [[ -d $HOME/.rbenv/plugins/rbenv-default-gems ]]; then
  puts 'Installed' 'rbenv-default-gems'
fi

if ! [[ -d $HOME/.rbenv/plugins/rbenv-ctags ]]; then
  puts 'Installing' 'rbenv-ctags'
  git clone https://github.com/tpope/rbenv-ctags.git \
    $HOME/.rbenv/plugins/rbenv-ctags
fi

if [[ -d $HOME/.rbenv/plugins/rbenv-ctags ]]; then
  puts 'Installed' 'rbenv-default-ctags'
fi

if ! [[ -d $HOME/.rbenv/plugins/rbenv-bundler ]]; then
  puts 'Installing' 'rbenv-bundler'
  git clone https://github.com/carsomyr/rbenv-bundler.git \
    $HOME/.rbenv/plugins/rbenv-bundler
  cd $HOME/.rbenv/plugins/rbenv-bundler
  git checkout $(git describe --abbrev=0 --tags)
  $HOME/.rbenv/bin/rbenv bundler on
fi

if [[ -d $HOME/.rbenv/plugins/rbenv-bundler ]]; then
  puts 'Installed' 'rbenv-bundler'
fi

if ! [[ -d $HOME/.pyenv ]]; then
  puts 'Installing' 'pyenv'
  git clone https://github.com/yyuu/pyenv.git $HOME/.pyenv
  cd $HOME/.pyenv
  git checkout $(git describe --abbrev=0 --tags)
fi

if [[ -d $HOME/.pyenv ]]; then
  puts 'Installed' 'pyenv'
fi

if ! [[ -d $HOME/.pyenv/plugins/pyenv-virtualenv ]]; then
  puts 'Installing' 'pyenv-virtualenv'
  git clone https://github.com/yyuu/pyenv-virtualenv.git \
    $HOME/.pyenv/plugins/pyenv-virtualenv
  cd $HOME/.pyenv/plugins/pyenv-virtualenv
  git checkout $(git describe --abbrev=0 --tags)
fi

if [[ -d $HOME/.pyenv/plugins/pyenv-virtualenv ]]; then
  puts 'Installed' 'pyenv-virtualenv'
fi

if ! [[ -d $HOME/.nvm ]]; then
  puts 'Installing' 'nvm'
  git clone https://github.com/creationix/nvm.git $HOME/.nvm
  cd $HOME/.nvm
  git checkout $(git describe --abbrev=0 --tags)
fi

if [[ -d $HOME/.nvm ]]; then
  puts 'Installed' 'nvm'
fi

if ! [[ -h $HOME/.local/share/nvim/site/spell ]]; then
  mkdir -p $HOME/.local/share/nvim/site
  if [[ -d /usr/share/vim/vimfiles/spell ]]; then
    ln -s /usr/share/vim/vimfiles/spell $HOME/.local/share/nvim/site
  fi
fi

if ! [[ -d $HOME/.config/nvim/plugged/nvimrc ]]; then
  puts 'Installing' 'nvimrc'
  curl -L https://rc.evansosenko.com/nvimrc/install.sh | sh
fi

if [[ -d $HOME/.config/nvim/plugged/nvimrc ]]; then
  puts 'Installed' 'nvimrc'
fi

if ! [[ -d $HOME/.tmux/plugins/tmuxrc ]]; then
  if [[ ! -z "${TMUX:-}" ]]; then
    puts 'Installing' 'tmuxrc'
    curl -L https://rc.evansosenko.com/tmuxrc/install.sh | sh
    puts 'Installed' 'tmux plugins'
  else
    puts 'Info' 'Run in a tmux session to install tmuxrc.'
  fi
fi

if [[ -d $HOME/.tmux/plugins/tmuxrc ]]; then
  puts 'Installed' 'tmuxrc'
fi

if ! [[ -e $HOME/.config/zsh/promptline.zsh ]]; then
  if [[ -d $HOME/.config/nvim/plugged/promptline.vim ]]; then
    puts 'Installing' 'promptline'
    nvim -c "PromptlineSnapshot ~/.config/zsh/promptline.zsh" -c qall!
  fi
fi

if [[ -e $HOME/.promptline.sh ]]; then
  puts 'Installed' 'promptline'
{'fraction_non_alphanumeric': 0.18341957503027634, 'fraction_numerical': 0.0017615325333039744, 'mean_word_length': 3.0644295302013425, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 24, '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': '598466', 'n_tokens_mistral': 3828, 'n_tokens_neox': 3799, 'n_words': 795}