<commit_before>#!/bin/bash

# Directory of this project.
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. $dir/config.sh

echo "Changing to the $dir directory"
cd $dir

echo "Creating $backup_dir"
mkdir -p $backup_dir

# Run pre-install script
read -p "Run pre-install script (y/n)? " -n 1 -r </dev/tty 
if [[ $REPLY =~ ^[Yy]$ ]]
then
  . $dir/pre_install.sh
fi

# Install packages
. $dir/install_packages.sh

printf "\n\n"
read -p "Backup is best-effort and fails silently. Proceed (y/n)? " -n 1 -r </dev/tty
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
  exit 1
fi

while IFS=, read config_path dotfile_path
do
  printf "\n\n"
  read -p "Install to ${config_path} (y/n)? " -n 1 -r </dev/tty
  if [[ ! $REPLY =~ ^[Yy]$ ]]
  then
    printf "\nSkipping ${config_path}\n"
    continue
  fi
  # Expand any env variables in the config.
  cpath=$(eval echo $config_path)
  dpath=$(eval echo $dotfile_path)
  
  printf "\n${cpath}"
  printf "\n ⇒ ${backup_dir}"
  mv "${cpath}" "${backup_dir}"/"${dpath}" 2>/dev/null
  printf "\n ← ${dir}/${dpath}\n"
  mkdir -p `dirname ${cpath}`
  ln -fs "${dir}"/"${dpath}" "${cpath}"
done < $dotfiles_list

# Run post-install script
printf "\n\n"
read -p "Run post-install script (y/n)? " -n 1 -r </dev/tty 
if [[ $REPLY =~ ^[Yy]$ ]]
then
  printf "\n\n"
  . $dir/post_install.sh
fi<commit_msg>Fix bug with dotfiles.csv reference<commit_after>#!/bin/bash

# Directory of this project.
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. $dir/config.sh

echo "Changing to the $dir directory"
cd $dir

echo "Creating $backup_dir"
mkdir -p $backup_dir

# Run pre-install script
read -p "Run pre-install script (y/n)? " -n 1 -r </dev/tty 
if [[ $REPLY =~ ^[Yy]$ ]]
then
  . $dir/pre_install.sh
fi

# Install packages
. $dir/install_packages.sh

printf "\n\n"
read -p "Backup is best-effort and fails silently. Proceed (y/n)? " -n 1 -r </dev/tty
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
  exit 1
fi

while IFS=, read config_path dotfile_path
do
  printf "\n\n"
  read -p "Install to ${config_path} (y/n)? " -n 1 -r </dev/tty
  if [[ ! $REPLY =~ ^[Yy]$ ]]
  then
    printf "\nSkipping ${config_path}\n"
    continue
  fi
  # Expand any env variables in the config.
  cpath=$(eval echo $config_path)
  dpath=$(eval echo $dotfile_path)
  
  printf "\n${cpath}"
  printf "\n ⇒ ${backup_dir}"
  mv "${cpath}" "${backup_dir}"/"${dpath}" 2>/dev/null
  printf "\n ← ${dir}/${dpath}\n"
  mkdir -p `dirname ${cpath}`
  ln -fs "${dir}"/"${dpath}" "${cpath}"
done < $dir/$dotfiles_list

# Run post-install script
printf "\n\n"
read -p "Run post-install script (y/n)? " -n 1 -r </dev/tty 
if [[ $REPLY =~ ^[Yy]$ ]]
then
  printf "\n\n"
  . $dir/post_install.sh
fi
{'fraction_non_alphanumeric': 0.20014964459408904, 'fraction_numerical': 0.005237560793116348, 'mean_word_length': 3.2243285939968405, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, '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': '5640745', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1091, 'n_words': 317}