<commit_before>#!/bin/bash

# get the path to this script
APP_PATH=`dirname "$0"`
APP_PATH=`( cd "$APP_PATH" && pwd )`

unattended=0
subinstall_params=""
for param in "$@"
do
  echo $param
  if [ $param="--unattended" ]; then
    echo "installing in unattended mode"
    unattended=1
    subinstall_params="--unattended"
  fi
done

default=y
while true; do
  if [[ "$unattended" == "1" ]]
  then
    resp=$default
  else
    [[ -t 0 ]] && { read -t 10 -n 2 -p $'\e[1;32mInstall ranger? [y/n] (default: '"$default"$')\e[0m\n' resp || resp=$default ; }
  fi
  response=`echo $resp | sed -r 's/(.*)$/\1=/'`

  if [[ $response =~ ^(y|Y)=$ ]]
  then

    sudo apt -y install ranger caca-utils libimage-exiftool-perl
    [ "$?" != "0" ] && echo "Something went while installing packages. Send this log to Tomas. Press enter to continue." && read

    # symlink vim settings
    rm ~/.config/ranger/rifle.conf
    rm ~/.config/ranger/commands.py
    rm ~/.config/ranger/rc.conf
    rm ~/.config/ranger/scope.sh

    mkdir ~/.config/ranger

    ln -fs $APP_PATH/rifle.conf ~/.config/ranger/rifle.conf
    ln -fs $APP_PATH/commands.py ~/.config/ranger/commands.py
    ln -fs $APP_PATH/rc.conf ~/.config/ranger/rc.conf
    ln -fs $APP_PATH/scope.sh ~/.config/ranger/scope.sh

    break
  elif [[ $response =~ ^(n|N)=$ ]]
  then
    break
  else
    echo " What? \"$resp\" is not a correct answer. Try y+Enter."
  fi
done
<commit_msg>updated ranger's install.sh<commit_after>#!/bin/bash

# get the path to this script
APP_PATH=`dirname "$0"`
APP_PATH=`( cd "$APP_PATH" && pwd )`

unattended=0
subinstall_params=""
for param in "$@"
do
  echo $param
  if [ $param="--unattended" ]; then
    echo "installing in unattended mode"
    unattended=1
    subinstall_params="--unattended"
  fi
done

default=y
while true; do
  if [[ "$unattended" == "1" ]]
  then
    resp=$default
  else
    [[ -t 0 ]] && { read -t 10 -n 2 -p $'\e[1;32mInstall ranger? [y/n] (default: '"$default"$')\e[0m\n' resp || resp=$default ; }
  fi
  response=`echo $resp | sed -r 's/(.*)$/\1=/'`

  if [[ $response =~ ^(y|Y)=$ ]]
  then

    sudo apt -y install ranger caca-utils libimage-exiftool-perl
    [ "$?" != "0" ] && echo "Something went while installing packages. Send this log to Tomas. Press enter to continue." && read

    mkdir -p ~/.config/ranger

    ln -fs $APP_PATH/rifle.conf ~/.config/ranger/rifle.conf
    ln -fs $APP_PATH/commands.py ~/.config/ranger/commands.py
    ln -fs $APP_PATH/rc.conf ~/.config/ranger/rc.conf
    ln -fs $APP_PATH/scope.sh ~/.config/ranger/scope.sh

    break
  elif [[ $response =~ ^(n|N)=$ ]]
  then
    break
  else
    echo " What? \"$resp\" is not a correct answer. Try y+Enter."
  fi
done

{'fraction_non_alphanumeric': 0.1778436457947388, 'fraction_numerical': 0.010374212671359764, 'mean_word_length': 2.8516405135520686, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5740200', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1020, 'n_words': 272}