<commit_before>#!/bin/bash

TMP_DIR=/tmp/publish_$$
mkdir -p $TMP_DIR
cd $TMP_DIR

REPO=$1
VERSION=$2
USER=$3

if [ -z "$USER" ]; then
  echo "Usage: publish.sh <repo> <version> <gh-user>"
  exit 1
fi

echo "Repository: $REPO"
echo "Version: $VERSION"

echo "Cloning git repos"
git clone -b gh-pages https://$USER@github.com/$REPO.git gh-pages
git clone -b $VERSION https://$USER@github.com/$REPO.git source
git clone -b $VERSION https://$USER@github.com/$REPO-documentation.git doco-source
<commit_msg>Improve credentials passing<commit_after>#!/bin/bash

TMP_DIR=/tmp/publish_$$
mkdir -p $TMP_DIR
cd $TMP_DIR

REPO=$1
VERSION=$2
USER=$GITHUB_USER
PASS=$<PASSWORD>

if [ -z $USER && ! -z "$3" ]; then
  USER=$3
fi
if [ -z $PASS && ! -z "$4" ]; then
  PASS=$4
fi

if [ -z "$USER" ]; then
  echo "Usage: publish.sh <repo> <version> [<gh-user> [gh-password]]"
  echo "       Username/password may also be passed by setting environment variables:"
  echo "       GITHUB_USER"
  echo "       GITHUB_PASSWORD"
  echo "       If no password set then will try to use private key"
  exit 1
fi

echo "Repository: $REPO"
echo "Version: $VERSION"

echo "Cloning git repos"
USER_PASS=$USER
if [ ! -z $PASS ]; then
  USER_PASS=$USER_PASS:$PASS
fi

git clone -b gh-pages https://$USER_PASS@github.com/$REPO.git gh-pages
git clone -b $VERSION https://$USER_PASS@github.com/$REPO.git source
git clone -b $VERSION https://$USER_PASS@github.com/$REPO-documentation.git doco-source

{'fraction_non_alphanumeric': 0.15652768284347232, 'fraction_numerical': 0.007518796992481203, 'mean_word_length': 3.88, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '5152882', 'n_tokens_mistral': 562, 'n_tokens_neox': 542, 'n_words': 155}