<commit_before>#!/bin/bash
: "${taito_project:?}"
: "${taito_target:?Target not given}"
: "${taito_target_env:?}"

prefix="${taito_project}"
if [[ "${taito_version:-}" -ge "1" ]]; then
  prefix="${taito_project}-${taito_target_env}"
fi

if [[ ${taito_target} != *"-"* ]]; then
  # Short pod name was given. Determine the full pod name.
  pod=$(kubectl get pods | grep "${prefix}" | \
    sed -e "s/${prefix}-//" | \
    grep "${taito_target}" | \
    head -n1 | awk "{print \"${prefix}-\" \$1;}")
fi

if [[ -z "${container}" ]] || \
   [[ "${container}" == "--" ]] || \
   [[ "${container}" == "-" ]]; then
  # No container name was given. Determine container name.
  container=$(echo "${pod}" | \
    sed -e 's/\([^0-9]*\)*/\1/;s/-[a-z0-9]*-[a-z0-9]*$//' | \
    sed -e "s/-${taito_target_env}//")
fi<commit_msg>fix(kubectl): container name quick fix for wordpress projects<commit_after>#!/bin/bash
: "${taito_project:?}"
: "${taito_target:?Target not given}"
: "${taito_target_env:?}"

prefix="${taito_project}"
if [[ "${taito_version:-}" -ge "1" ]]; then
  prefix="${taito_project}-${taito_target_env}"
fi

if [[ ${taito_target} != *"-"* ]]; then
  # Short pod name was given. Determine the full pod name.
  pod=$(kubectl get pods | grep "${prefix}" | \
    sed -e "s/${prefix}-//" | \
    grep "${taito_target}" | \
    head -n1 | awk "{print \"${prefix}-\" \$1;}")
fi

if [[ -z "${container}" ]] || \
   [[ "${container}" == "--" ]] || \
   [[ "${container}" == "-" ]]; then
  # No container name was given. Determine container name.
  if [[ "${pod}" == *"wordpress"* ]]; then
    # Required for wordpress-template based projects
    # --> env is in container name also
    # TODO remove this hack
    container=$(echo "${pod}" | \
      sed -e 's/\([^0-9]*\)*/\1/;s/-[a-z0-9]*-[a-z0-9]*$//')
  else
    container=$(echo "${pod}" | \
      sed -e 's/\([^0-9]*\)*/\1/;s/-[a-z0-9]*-[a-z0-9]*$//' | \
      sed -e "s/-${taito_target_env}//")
  fi
fi
{'fraction_non_alphanumeric': 0.27626858021527423, 'fraction_numerical': 0.013839056893900564, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1362431', 'n_tokens_mistral': 791, 'n_tokens_neox': 747, 'n_words': 166}