<commit_before>#!/bin/bash

: "${taito_cli_path:?}"
: "${template_source_git:?}"
: "${template_default_dest_git:?}"
: "${template:?}"

export mode=${1}

export taito_company
export taito_family
export taito_application
export taito_suffix
export taito_repo_name

echo
echo "Repository name, namespace and labels will be constituted from the following"
echo "details. Please give a short word or abbreviation for each:"
echo
echo "  1) Company"
echo "  2) Product family (optional)"
echo "  3) Application name"
echo "  4) Implementation suffix (optional)"
echo
echo "1) Company (e.g. 'seedi')?"
read -r taito_company
if [[ -z "${taito_company}" ]] || [[ ${#taito_company} -gt 12 ]]; then
  echo "ERROR: not given or too long"
  exit 1
fi
echo
echo "2) Optional: Product family (e.g. 'merri')?"
read -r taito_family
if [[ ${#taito_family} -gt 14 ]]; then
  echo "ERROR: too long"
  exit 1
fi
echo
echo "3) Application name (e.g. 'chat')?"
read -r taito_application # TODO application
if [[ -z "${taito_application}" ]] || [[ ${#taito_application} -gt 14 ]]; then
  echo "ERROR: not given or too long"
  exit 1
fi
echo
echo "4) Optional: implementation suffix (e.g. 'api', 'gui', ...)"
read -r taito_suffix # TODO application_suffix
if [[ ${#taito_suffix} -gt 10 ]]; then
  echo "ERROR: too long"
  exit 1
fi

if [[ "${taito_suffix}" != "" ]]; then
  taito_repo_name="${taito_family:-$taito_company}-${taito_application}-${taito_suffix}"
else
  taito_repo_name="${taito_family:-$taito_company}-${taito_application}"
fi<commit_msg>feat: Do not allow special characters in names<commit_after>#!/bin/bash

: "${taito_cli_path:?}"
: "${template_source_git:?}"
: "${template_default_dest_git:?}"
: "${template:?}"

export mode=${1}

export taito_company
export taito_family
export taito_application
export taito_suffix
export taito_repo_name

echo
echo "Repository name, namespace and labels will be constituted from the following"
echo "details:"
echo
echo "  1) Company"
echo "  2) Product family (optional)"
echo "  3) Application name"
echo "  4) Implementation suffix (optional)"
echo
echo "NOTE: Please give a short word or abbreviation for each."
echo "No special characters, only alphabets!"
echo
echo "1) Company (e.g. 'seedi')?"
read -r taito_company
if ! [[ "${taito_company}" =~ ^[a-zA-Z]+$ ]] || \
   [[ ${#taito_company} -gt 14 ]]; then
  echo "ERROR: invalid value or too long"
  exit 1
fi
echo
echo "2) Optional: Product family (e.g. 'merri')?"
read -r taito_family
if ! [[ "${taito_family}" =~ ^[a-zA-Z]*$ ]] || \
   [[ ${#taito_family} -gt 14 ]]; then
  echo "ERROR: invalid value or too long"
  exit 1
fi
echo
echo "3) Application name (e.g. 'chat')?"
read -r taito_application
if ! [[ "${taito_application}" =~ ^[a-zA-Z]+$ ]] || \
   [[ ${#taito_application} -gt 14 ]]; then
  echo "ERROR: invalid value or too long"
  exit 1
fi
echo
echo "4) Optional: implementation suffix (e.g. 'api', 'gui', ...)"
read -r taito_suffix # TODO application_suffix
if ! [[ "${taito_suffix}" =~ ^[a-zA-Z]*$ ]] || \
   [[ ${#taito_suffix} -gt 10 ]]; then
  echo "ERROR: invalid value or too long"
  exit 1
fi

if [[ "${taito_suffix}" != "" ]]; then
  taito_repo_name="${taito_family:-$taito_company}-${taito_application}-${taito_suffix}"
else
  taito_repo_name="${taito_family:-$taito_company}-${taito_application}"
fi
{'fraction_non_alphanumeric': 0.1663647342995169, 'fraction_numerical': 0.012681159420289856, 'mean_word_length': 4.751736111111111, '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': '4142270', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1174, 'n_words': 363}