<commit_before>#!/bin/bash

if [ ! -n "$path" ]; then
  echo '[!] Input $path missing!'
  exit 1
fi

# this expansion is required for paths with ~
#  more information: http://stackoverflow.com/questions/3963716/how-to-manually-expand-a-special-variable-ex-tilde-in-bash
eval expanded_target_path="$path"

is_do_with_sudo=1 # use sudo? default is yes
if [[ -n "$with_sudo" && "$with_sudo" == 'false' ]]; then
  is_do_with_sudo=0
fi

function print_and_do_command {
  echo "$ $@"
  $@
}

echo "Adding $expanded_target_path ..."
if [ $is_do_with_sudo -eq 1 ]; then
  echo " (i) Using sudo"
  print_and_do_command sudo mkdir "$expanded_target_path"
else
  echo " (i) NOT using sudo"
  print_and_do_command mkdir "$expanded_target_path"<commit_msg>Added step to check if folder exits<commit_after>#!/bin/bash

if [ ! -n "$path" ]; then
  echo '[!] Input $path missing!'
  exit 1
fi

if [ ! -e "${path}" ]; then
  print_failed_message "The specified already exists at: ${expanded_download_local_path}"
  exit 0
fi

# this expansion is required for paths with ~
#  more information: http://stackoverflow.com/questions/3963716/how-to-manually-expand-a-special-variable-ex-tilde-in-bash
eval expanded_target_path="$path"

is_do_with_sudo=1 # use sudo? default is yes
if [[ -n "$with_sudo" && "$with_sudo" == 'false' ]]; then
  is_do_with_sudo=0
fi

function print_and_do_command {
  echo "$ $@"
  $@
}

echo "Adding $expanded_target_path ..."
if [ $is_do_with_sudo -eq 1 ]; then
  echo " (i) Using sudo"
  print_and_do_command sudo mkdir "$expanded_target_path"
else
  echo " (i) NOT using sudo"
  print_and_do_command mkdir "$expanded_target_path"
{'fraction_non_alphanumeric': 0.1354484441732764, 'fraction_numerical': 0.014032946918852958, 'mean_word_length': 4.466666666666667, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '268198', 'n_tokens_mistral': 639, 'n_tokens_neox': 592, 'n_words': 151}