<commit_before>#!/bin/sh

set -eu

if [ $# -lt 1 ]; then
  echo "Usage $0 <target>" 1>&2
  exit 1
fi

TARGET=${1}

case $TARGET in
  prod)
    API_URL="https://api.cloud.service.gov.uk"
    ;;
  staging)
    API_URL="https://api.staging.cloudpipeline.digital"
    ;;
  *)
    echo "Unrecognised target '${TARGET}'" 1>&2
    exit 1
    ;;
esac

TMPDIR=${TMPDIR:-/tmp}
CF_HOME=$(mktemp -d "${TMPDIR}/cf_home.XXXXXX")
cleanup() {
  echo "Cleaning up temporary CF_HOME..."
  cf logout || true
  rm -r "${CF_HOME}"
}
trap 'cleanup' EXIT
<commit_msg>Extend cf_subshell_scoped_login script for London<commit_after>#!/bin/sh

set -eu

if [ $# -lt 1 ]; then
  echo "Usage $0 <target>" 1>&2
  exit 1
fi

TARGET=${1}

case $TARGET in
  prod)
    API_URL="https://api.cloud.service.gov.uk"
    ;;
  prod-lon)
    API_URL="https://api.london.cloud.service.gov.uk"
    ;;
  staging)
    API_URL="https://api.staging.cloudpipeline.digital"
    ;;
  stg-lon)
    API_URL="https://api.london.staging.cloudpipeline.digital"
    ;;
  *)
    echo "Unrecognised target '${TARGET}'" 1>&2
    exit 1
    ;;
esac

TMPDIR=${TMPDIR:-/tmp}
CF_HOME=$(mktemp -d "${TMPDIR}/cf_home.XXXXXX")
cleanup() {
  echo "Cleaning up temporary CF_HOME..."
  cf logout || true
  rm -r "${CF_HOME}"
}
trap 'cleanup' EXIT

{'fraction_non_alphanumeric': 0.18231611893583724, 'fraction_numerical': 0.014084507042253521, 'mean_word_length': 3.0993589743589745, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 6, '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': '2346515', 'n_tokens_mistral': 530, 'n_tokens_neox': 513, 'n_words': 108}