<commit_before>
MY_DIR="$( cd "$( dirname "${0}" )" && pwd )"

readonly github_cyber_dojo=https://github.com/cyber-dojo
readonly raw_github_cd_org=https://raw.githubusercontent.com/cyber-dojo
readonly exe="${MY_DIR}/../../cyber-dojo"

# Tests override COMMANDER_IMAGE so cyber-dojo script does
# _NOT_ get the commander-image tag from versioner:latest
export COMMANDER_IMAGE=cyberdojo/commander:latest

# - - - - - - - - - - - - - - - - - - - - - - - - -

CD_DIR()
{
  echo "$( cd "${MY_DIR}" && cd ../../../../cyber-dojo && pwd )"
}

CDL_DIR()
{
  echo "$(cd "${MY_DIR}" && cd ../../../../cyber-dojo-languages && pwd )"
}


on_CI()
{
  [[ -n "${CIRCLE_SHA1}" ]] || [[ -n "${TRAVIS}" ]]
}

# - - - - - - - - - - - - - - - - - - - - - - - - -

custom_urls()
{
  if on_CI; then
    echo -n "${github_cyber_dojo}/custom"
  else
    echo -n "$(CD_DIR)/custom"
  fi
}

# - - - - - - - - - - - - - - - - - - - - - - - - -

exercises_urls()
{
  if on_CI; then
    echo -n "${github_cyber_dojo}/exercises"
  else
    echo -n "$(CD_DIR)/exercises"
  fi
}

# - - - - - - - - - - - - - - - - - - - - - - - - -

languages_urls()
{
  if on_CI; then
    echo -n $(curl --silent "${raw_github_cd_org}/languages/master/url_list/small")
  else
    echo -n "$(CDL_DIR)/gcc-assert \
             $(CDL_DIR)/python-unittest \
             $(CDL_DIR)/ruby-minitest"
  fi
}

# - - - - - - - - - - - - - - - - - - - - - - - - -

declare -a service_names=(
  differ
  grafana
  mapper
  nginx
  prometheus
  ragger
  runner
  saver
  web
  zipper
)

# - - - - - - - - - - - - - - - - - - - - - - - - -

clean()             { ${exe} clean               $* ; } # >${stdoutF} 2>${stderrF}; }
#clean()             { ${exe} clean               $* >${stdoutF} 2>${stderrF}; }
down()              { ${exe} down                $* >${stdoutF} 2>${stderrF}; }
logs()              { ${exe} logs                $* >${stdoutF} 2>${stderrF}; }
sh()                { ${exe} sh                  $* >${stdoutF} 2>${stderrF}; }
startPoint()        { ${exe} start-point         $* >${stdoutF} 2>${stderrF}; }
startPointCreate()  { ${exe} start-point create  $* >${stdoutF} 2>${stderrF}; }
startPointInspect() { ${exe} start-point inspect $* >${stdoutF} 2>${stderrF}; }
startPointLs()      { ${exe} start-point ls      $* >${stdoutF} 2>${stderrF}; }
startPointRm()      { ${exe} start-point rm      $* >${stdoutF} 2>${stderrF}; }
startPointUpdate()  { ${exe} start-point update  $* >${stdoutF} 2>${stderrF}; }<commit_msg>put helper scripts back to capturing stdout/stderr for tests<commit_after>
MY_DIR="$( cd "$( dirname "${0}" )" && pwd )"

readonly github_cyber_dojo=https://github.com/cyber-dojo
readonly raw_github_cd_org=https://raw.githubusercontent.com/cyber-dojo
readonly exe="${MY_DIR}/../../cyber-dojo"

# Tests override COMMANDER_IMAGE so cyber-dojo script does
# _NOT_ get the commander-image tag from versioner:latest
export COMMANDER_IMAGE=cyberdojo/commander:latest

# - - - - - - - - - - - - - - - - - - - - - - - - -

CD_DIR()
{
  echo "$( cd "${MY_DIR}" && cd ../../../../cyber-dojo && pwd )"
}

CDL_DIR()
{
  echo "$(cd "${MY_DIR}" && cd ../../../../cyber-dojo-languages && pwd )"
}


on_CI()
{
  [[ -n "${CIRCLE_SHA1}" ]] || [[ -n "${TRAVIS}" ]]
}

# - - - - - - - - - - - - - - - - - - - - - - - - -

custom_urls()
{
  if on_CI; then
    echo -n "${github_cyber_dojo}/custom"
  else
    echo -n "$(CD_DIR)/custom"
  fi
}

# - - - - - - - - - - - - - - - - - - - - - - - - -

exercises_urls()
{
  if on_CI; then
    echo -n "${github_cyber_dojo}/exercises"
  else
    echo -n "$(CD_DIR)/exercises"
  fi
}

# - - - - - - - - - - - - - - - - - - - - - - - - -

languages_urls()
{
  if on_CI; then
    echo -n $(curl --silent "${raw_github_cd_org}/languages/master/url_list/small")
  else
    echo -n "$(CDL_DIR)/gcc-assert \
             $(CDL_DIR)/python-unittest \
             $(CDL_DIR)/ruby-minitest"
  fi
}

# - - - - - - - - - - - - - - - - - - - - - - - - -

declare -a service_names=(
  differ
  grafana
  mapper
  nginx
  prometheus
  ragger
  runner
  saver
  web
  zipper
)

# - - - - - - - - - - - - - - - - - - - - - - - - -

clean()             { ${exe} clean               $* >${stdoutF} 2>${stderrF}; }
down()              { ${exe} down                $* >${stdoutF} 2>${stderrF}; }
logs()              { ${exe} logs                $* >${stdoutF} 2>${stderrF}; }
sh()                { ${exe} sh                  $* >${stdoutF} 2>${stderrF}; }
startPoint()        { ${exe} start-point         $* >${stdoutF} 2>${stderrF}; }
startPointCreate()  { ${exe} start-point create  $* >${stdoutF} 2>${stderrF}; }
startPointInspect() { ${exe} start-point inspect $* >${stdoutF} 2>${stderrF}; }
startPointLs()      { ${exe} start-point ls      $* >${stdoutF} 2>${stderrF}; }
startPointRm()      { ${exe} start-point rm      $* >${stdoutF} 2>${stderrF}; }
startPointUpdate()  { ${exe} start-point update  $* >${stdoutF} 2>${stderrF}; }
{'fraction_non_alphanumeric': 0.23707773707773708, 'fraction_numerical': 0.005087505087505087, 'mean_word_length': 1.753501400560224, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 45, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 36, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '751253', 'n_tokens_mistral': 2021, 'n_tokens_neox': 1919, 'n_words': 323}