<commit_before>#!/bin/bash
#
# Author: <NAME> <<EMAIL>>
#
# Usage: ./authorize.sh <user-name>
# Script to add the public key of a GitHub user to the
# list of authorized keys for git on this server

DEFAULT_CONFIG_FILE="config.rc"

# Exit on error
set -e

# $CONFIG_FILE should point at the config file created by setup.sh
if [ -z "$CONFIG_FILE" ]; then
	CONFIG_FILE="$DEFAULT_CONFIG_FILE"
fi

eval $(cat "$CONFIG_FILE")

# User needs a name
if [ -z "$1" ]; then
	echo "User must have a non-empty name"
	exit 1
fi

USER_NAME="$1"

curl -w "\n" "https://github.com/${USER_NAME}.keys" | while read key
do
	echo "environment=\"GITHUB_USERNAME=$USER_NAME\" $key" | tee -a "$GIT_HOME/.ssh/authorized_keys"
done<commit_msg>Guard empty keys<commit_after>#!/bin/bash
#
# Author: <NAME> <<EMAIL>>
#
# Usage: ./authorize.sh <user-name>
# Script to add the public key of a GitHub user to the
# list of authorized keys for git on this server

DEFAULT_CONFIG_FILE="config.rc"

# Exit on error
set -e

# $CONFIG_FILE should point at the config file created by setup.sh
if [ -z "$CONFIG_FILE" ]; then
	CONFIG_FILE="$DEFAULT_CONFIG_FILE"
fi

eval $(cat "$CONFIG_FILE")

# User needs a name
if [ -z "$1" ]; then
	echo "User must have a non-empty name"
	exit 1
fi

USER_NAME="$1"

curl -w "\n" "https://github.com/${USER_NAME}.keys" | while read key
do
	[ "" != "key" ] && echo "environment=\"GITHUB_USERNAME=$USER_NAME\" $key" | tee -a "$GIT_HOME/.ssh/authorized_keys"
done
{'fraction_non_alphanumeric': 0.14697802197802198, 'fraction_numerical': 0.004120879120879121, 'mean_word_length': 4.148409893992933, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '6557588', 'n_tokens_mistral': 533, 'n_tokens_neox': 516, 'n_words': 176}