<commit_before>#!/bin/sh

set -e

# $1 will be the version being upgraded from if this is an upgrade
if [ "$1" = "" ] ; then
  OPERATION="install"
else
  OPERATION="upgrade"
fi

# Find out whether or not the buildkite-agent user exists
getent passwd buildkite-agent > /dev/null 2&>1
if [ $? -eq 0 ]; then
  BK_USER_EXISTS=true
else
  BK_USER_EXISTS=false
fi

# Add the buildkite user if it doesn't exist on installation
if [ "$OPERATION" = "install" ] ; then
  if [ "$BK_USER_EXISTS" = "false" ]; then
    # Create the buildkite system user and set it's home to /var/lib/buildkite
    useradd --system --no-create-home -d /var/lib/buildkite-agent buildkite-agent

    # We create it's home folder in a seperate command so it doesn't blow up if
    # the folder already exists
    mkdir -p /var/lib/buildkite-agent

    # The user exists now!
    BK_USER_EXISTS=true
  fi
fi<commit_msg>Added some debugging stuff to the install script.<commit_after>#!/bin/sh

set -e

# $1 will be the version being upgraded from if this is an upgrade
if [ "$1" = "" ] ; then
  OPERATION="install"
else
  OPERATION="upgrade"
fi

# Find out whether or not the buildkite-agent user exists
getent passwd buildkite-agent > /dev/null 2&>1
if [ $? -eq 0 ]; then
  BK_USER_EXISTS=true
else
  BK_USER_EXISTS=false
fi

echo "OPERATION $OPERATION"
echo "BK_USER_EXISTS $BK_USER_EXISTS"

# Add the buildkite user if it doesn't exist on installation
if [ "$OPERATION" = "install" ] ; then
  if [ "$BK_USER_EXISTS" = "false" ]; then
    # Create the buildkite system user and set it's home to /var/lib/buildkite
    useradd --system --no-create-home -d /var/lib/buildkite-agent buildkite-agent

    # We create it's home folder in a seperate command so it doesn't blow up if
    # the folder already exists
    mkdir -p /var/lib/buildkite-agent

    # The user exists now!
    BK_USER_EXISTS=true
  fi
fi
{'fraction_non_alphanumeric': 0.0998398291510945, 'fraction_numerical': 0.005339028296849973, 'mean_word_length': 3.39906103286385, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4038360', 'n_tokens_mistral': 686, 'n_tokens_neox': 634, 'n_words': 230}