<commit_before>#!/bin/bash

set -e

BRANCH="offline-build"
REMOTE="<EMAIL>:CoderDojoPotsdam/intro.git"

if ! [ -n "$id_rsa" ]; then
  echo "You should set the variable id_rsa to contain a valid ssh deploy key to origin."
  exit 1
fi
if ! [ -n "$OFFLINE_BUILD_FOLDER" ]; then
  echo "You should set the variable OFFLINE_BUILD_FOLDER to contain the built version of the offline tutorial."
  exit 1
fi

echo "Create a temporary folder for checking out $BRANCH."
mkdir -p temp
cp -r .git temp
(
  set -e
  cd temp
  git fetch origin "+$BRANCH:$BRANCH"
  git checkout "$BRANCH"
)
mv temp/.git "$OFFLINE_BUILD_FOLDER"
rm -r temp

(
  set -e
  cd "$OFFLINE_BUILD_FOLDER"
  echo "Commit offline version into branch \"$BRANCH\""
  git add --all .
  git commit -am"Automated build $TRAVIS_BUILD_NUMBER"
  echo "$id_rsa" > id_rsa
  chmod 600 id_rsa
  ssh-agent bash -c "ssh-add id_rsa; git push --set-upstream \"$REMOTE\" \"$BRANCH\""
  rm -r .git
)<commit_msg>echo remote<commit_after>#!/bin/bash

set -e

BRANCH="offline-build"
REMOTE="<EMAIL>:CoderDojoPotsdam/intro.git"

if ! [ -n "$id_rsa" ]; then
  echo "You should set the variable id_rsa to contain a valid ssh deploy key to origin."
  exit 1
fi
if ! [ -n "$OFFLINE_BUILD_FOLDER" ]; then
  echo "You should set the variable OFFLINE_BUILD_FOLDER to contain the built version of the offline tutorial."
  exit 1
fi

echo "Create a temporary folder for checking out $BRANCH."
mkdir -p temp
cp -r .git temp
(
  set -e
  cd temp
  git fetch origin "+$BRANCH:$BRANCH"
  git checkout "$BRANCH"
)
mv temp/.git "$OFFLINE_BUILD_FOLDER"
rm -r temp

(
  set -e
  cd "$OFFLINE_BUILD_FOLDER"
  echo "Commit offline version into branch \"$BRANCH\""
  git add --all .
  git commit -am"Automated build $TRAVIS_BUILD_NUMBER"
  echo "$id_rsa" > id_rsa
  chmod 600 id_rsa
  echo "Push to $REMOTE"
  ssh-agent bash -c "ssh-add id_rsa; git push --set-upstream \"$REMOTE\" \"$BRANCH\""
  rm -r .git
)
{'fraction_non_alphanumeric': 0.11804472178887156, 'fraction_numerical': 0.005200208008320333, 'mean_word_length': 3.516431924882629, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7044027', 'n_tokens_mistral': 776, 'n_tokens_neox': 732, 'n_words': 249}