<commit_before>#!/bin/bash

MAKE="make"

if [ -z "${SOURCE_ROOT}" ]
then
  echo "Please set SOURCE_ROOT first; SOURCE_ROOT is the directory where source code will be kept."
  exit
fi

if [ -z "${INSTALL_ROOT}" ]
then
  echo "Please set INSTALL_ROOT first; INSTALL_ROOT is the directory where the software will be installed."
  exit
fi

# Save script directory
DIR=`realpath ${0}`
DIR=`dirname ${DIR}`

# Usage function
usage () {
  echo "Usage: ${0} <install | update> <branch>"
}

# Create directories
mkdir -p "${SOURCE_ROOT}"
mkdir -p "${INSTALL_ROOT}"

# Process command line
if [ ${#} -lt 2 ]
then
  usage
  exit
else
  COMMAND=${1}
  BRANCH=${2}
fi

if [ ${COMMAND} = "install" ]
then
  source ${DIR}/install.sh
elif [ ${COMMAND} = "update" ]
then
  source ${DIR}/update.sh
else
  usage
fi

exit
<commit_msg>Improving the command line parameters.<commit_after>#!/bin/bash

MAKE="make"

if [ -z "${SOURCE_ROOT}" ]
then
  echo "Please set SOURCE_ROOT first; SOURCE_ROOT is the directory where source code will be kept."
  exit
fi

if [ -z "${INSTALL_ROOT}" ]
then
  echo "Please set INSTALL_ROOT first; INSTALL_ROOT is the directory where the software will be installed."
  exit
fi

# Save script directory
DIR=`realpath ${0}`
DIR=`dirname ${DIR}`

# Usage function
usage () {
  echo "Usage: ${0} <install | update | tune> <branch | scenario> <configuration_path>"
  echo "\tinstall <branch>: install the specified branch of AMBER."
  echo "\t\tbranch: development branch to install. The default is master."
  echo "\tupdate <branch>: update an already existing installation of AMBER. The default branch is master."
  echo "\t\tbranch: development branch to update. The default is master."
  echo "\ttune scenario configuration_path: tune the AMBER modules and save the generated configuration files."
  echo "\t\tscenario: script containing tuning parameters and constraints."
  echo "\t\tconfiguration_path: directory where to save the generated configuration files."
}

# Create directories
mkdir -p "${SOURCE_ROOT}"
mkdir -p "${INSTALL_ROOT}"

# Process command line
if [ ${#} -lt 1 -o ${#} -gt 3 ]
then
  usage
  exit
else
  COMMAND=${1}
  if [ ${COMMAND} = "install" ]
  then
    if [ -n ${2} ]
    then
      BRANCH=${2}
    else
      BRANCH="master"
    fi
    source ${DIR}/install.sh
  elif [ ${COMMAND} = "update" ]
  then
    if [ -n ${2} ]
    then
      BRANCH=${2}
    else
      BRANCH="master"
    fi
    source ${DIR}/update.sh
  elif [ ${COMMAND} = "tune" ]
  then
    SCENARIO=${2}
    CONFS=${3}
    source ${DIR}/tune.sh
  else
    usage
  fi
fi

exit

{'fraction_non_alphanumeric': 0.130283055447848, 'fraction_numerical': 0.006203955021326095, 'mean_word_length': 3.4714038128249567, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '577972', 'n_tokens_mistral': 864, 'n_tokens_neox': 843, 'n_words': 303}