<commit_before>#!/bin/bash -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [ ! "${1}" = "--yes" ]; then
  echo -e "USAGE: $(basename $0) (--yes)\n\n***dry run***\n"
  __debug() {
    echo -e "\$ $@"
  }
  DEBUG=__debug
fi

read -p 'Setup home directory? (y/N) '
if [[ $REPLY =~ ^[Yy] ]]; then
  $DEBUG mkdir -p $HOME/bin
  $DEBUG cp -r $DIR/bin/*.sh $HOME/bin
  $DEBUG chmod +x $HOME/bin/*.sh
  $DEBUG echo "PATH=\$PATH:\$HOME/bin" | $DEBUG tee -a $HOME/.bashrc

  # bash settings
  $DEBUG echo "export GOPATH=\$HOME/go" | $DEBUG tee -a $HOME/.bashrc
  $DEBUG echo "export HISTCONTROL=erasedups:ignorespace" | $DEBUG tee -a $HOME/.bashrc
  $DEBUG echo "export HISTSIZE=5000" | $DEBUG tee -a $HOME/.bashrc
  $DEBUG echo "shopt -s histappend" | $DEBUG tee -a $HOME/.bashrc

  $DEBUG echo "source $HOME/.bashrc"  | $DEBUG tee -a $HOME/.bash_profile
  $DEBUG echo "source $HOME/.bash_aliases"  | $DEBUG tee -a $HOME/.bash_profile
  $DEBUG echo "[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion" | $DEBUG tee -a $HOME/.bash_profile

  # ssh
  $DEBUG mkdir -p $HOME/.ssh
  $DEBUG chmod 700 $HOME/.ssh
fi

read -p 'Add /etc files? (y/N) '
if [[ $REPLY =~ ^[Yy] ]]; then
  $DEBUG sudo cp -r $DIR/etc/* /etc/
fi

read -p 'Install dotfile symlinks? (y/N) '
if [[ $REPLY =~ ^[Yy] ]]; then
  for FILE in $(find $DIR/dotfiles -type f); do
    FILE_PATH=${FILE#"${DIR}/dotfiles"/}
    $DEBUG rm -f ${HOME}/${FILE_PATH}
    $DEBUG ln -s $FILE ${HOME}/${FILE_PATH}
  done
fi

read -p 'Install homebrew? (y/N) '
if [[ $REPLY =~ ^[Yy] ]]; then
  # homebrew
  if [ -z "$(which brew)" ]; then
    $DEBUG sudo xcode-select --install
    $DEBUG sudo xcodebuild -license
    $DEBUG ruby -e "$($DEBUG curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  fi

  $DEBUG brew update

  TAPS=(
    caskformula/caskformula
    homebrew/cask
    homebrew/cask-drivers
    homebrew/cask-versions
  )

  for TAP in "${TAPS[@]}"; do
    $DEBUG brew tap --full ${TAP}
  done

  CASKS=(
    atom
    bettertouchtool
    burp-suite
    copyclip
    docker-edge
    gimp
    google-chrome
    google-cloud-sdk
    gpg-suite
    intel-power-gadget
    istat-menus
    iterm2
    keybase
    kubernetic
    metasploit
    osxfuse
    postico
    slack
    sublime-text
    tor-browser
    tunnelblick
    xquartz
  )

  for CASK in "${CASKS[@]}"; do
    $DEBUG brew cask install ${CASK}
  done

  PACKAGES=(
    ark
    autoconf<commit_msg>add minikube<commit_after>#!/bin/bash -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [ ! "${1}" = "--yes" ]; then
  echo -e "USAGE: $(basename $0) (--yes)\n\n***dry run***\n"
  __debug() {
    echo -e "\$ $@"
  }
  DEBUG=__debug
fi

read -p 'Setup home directory? (y/N) '
if [[ $REPLY =~ ^[Yy] ]]; then
  $DEBUG mkdir -p $HOME/bin
  $DEBUG cp -r $DIR/bin/*.sh $HOME/bin
  $DEBUG chmod +x $HOME/bin/*.sh
  $DEBUG echo "PATH=\$PATH:\$HOME/bin" | $DEBUG tee -a $HOME/.bashrc

  # bash settings
  $DEBUG echo "export GOPATH=\$HOME/go" | $DEBUG tee -a $HOME/.bashrc
  $DEBUG echo "export HISTCONTROL=erasedups:ignorespace" | $DEBUG tee -a $HOME/.bashrc
  $DEBUG echo "export HISTSIZE=5000" | $DEBUG tee -a $HOME/.bashrc
  $DEBUG echo "shopt -s histappend" | $DEBUG tee -a $HOME/.bashrc

  $DEBUG echo "source $HOME/.bashrc"  | $DEBUG tee -a $HOME/.bash_profile
  $DEBUG echo "source $HOME/.bash_aliases"  | $DEBUG tee -a $HOME/.bash_profile
  $DEBUG echo "[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion" | $DEBUG tee -a $HOME/.bash_profile

  # ssh
  $DEBUG mkdir -p $HOME/.ssh
  $DEBUG chmod 700 $HOME/.ssh
fi

read -p 'Add /etc files? (y/N) '
if [[ $REPLY =~ ^[Yy] ]]; then
  $DEBUG sudo cp -r $DIR/etc/* /etc/
fi

read -p 'Install dotfile symlinks? (y/N) '
if [[ $REPLY =~ ^[Yy] ]]; then
  for FILE in $(find $DIR/dotfiles -type f); do
    FILE_PATH=${FILE#"${DIR}/dotfiles"/}
    $DEBUG rm -f ${HOME}/${FILE_PATH}
    $DEBUG ln -s $FILE ${HOME}/${FILE_PATH}
  done
fi

read -p 'Install homebrew? (y/N) '
if [[ $REPLY =~ ^[Yy] ]]; then
  # homebrew
  if [ -z "$(which brew)" ]; then
    $DEBUG sudo xcode-select --install
    $DEBUG sudo xcodebuild -license
    $DEBUG ruby -e "$($DEBUG curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  fi

  $DEBUG brew update

  TAPS=(
    caskformula/caskformula
    homebrew/cask
    homebrew/cask-drivers
    homebrew/cask-versions
  )

  for TAP in "${TAPS[@]}"; do
    $DEBUG brew tap --full ${TAP}
  done

  CASKS=(
    atom
    bettertouchtool
    burp-suite
    copyclip
    docker-edge
    gimp
    google-chrome
    google-cloud-sdk
    gpg-suite
    intel-power-gadget
    istat-menus
    iterm2
    keybase
    kubernetic
    metasploit
    minikube
    osxfuse
    postico
    slack
    sublime-text
    tor-browser
    tunnelblick
    xquartz
  )

  for CASK in "${CASKS[@]}"; do
    $DEBUG brew cask install ${CASK}
  done

  PACKAGES=(
    ark
    autoconf
{'fraction_non_alphanumeric': 0.1696969696969697, 'fraction_numerical': 0.0044444444444444444, 'mean_word_length': 2.6975354742345035, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '589972', 'n_tokens_mistral': 2043, 'n_tokens_neox': 1920, 'n_words': 515}