<commit_before>#!/bin/sh

# Directory in which librarian-puppet should manage its modules directory
PUPPET_DIR='/vagrant/puppet'

# NB: librarian-puppet might need git installed. If it is not already installed
# in your basebox, this will manually install it at this point using apt or yum
GIT=/usr/bin/git
APT_GET=/usr/bin/apt-get
YUM=/usr/sbin/yum
if [ ! -x $GIT ]; then
    if [ -x $YUM ]; then
        yum -q -y install git-core
    elif [ -x $APT_GET ]; then
        apt-get -q -y install git-core
    else
        echo "No package installer available. You may need to install git manually."
    fi
fi

if [ `gem query --local | grep librarian-puppet | wc -l` -eq 0 ]; then
  gem install librarian-puppet
  cd $PUPPET_DIR && librarian-puppet install --clean
else
  cd $PUPPET_DIR && librarian-puppet update
fi

# now we run puppet
puppet apply -vv  --modulepath=$PUPPET_DIR/modules/ $PUPPET_DIR/manifests/main.pp
<commit_msg>Do an update step and correctly find package manager<commit_after>#!/bin/sh

# Directory in which librarian-puppet should manage its modules directory
PUPPET_DIR='/vagrant/puppet'

if [ -n "$(type yum 2>/dev/null)" ];then
    echo "Installing puppet, git, and updating through yum"
    sudo yum clean all -q
    sudo yum -q -y update
    sudo yum -q -y install git-core puppet
elif [ -n "$(type apt-get 2>/dev/null)" ];then
    echo "Installing puppet, git, and updating through apt-get"
    sudo apt-get -q -y update
    sudo apt-get -q -y upgrade
    sudo apt-get -q -y install git-core puppet
    sudo apt-get -q -y clean all
else
    echo "No package installer available. You may need to install git manually."
fi

if [ `gem query --local | grep librarian-puppet | wc -l` -eq 0 ]; then
  gem install librarian-puppet
  cd $PUPPET_DIR && librarian-puppet install --clean
else
  cd $PUPPET_DIR && librarian-puppet update
fi

# now we run puppet
sudo puppet apply -vv  --modulepath=$PUPPET_DIR/modules/ $PUPPET_DIR/manifests/main.pp

{'fraction_non_alphanumeric': 0.10234215885947047, 'fraction_numerical': 0.002036659877800407, 'mean_word_length': 3.119496855345912, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7359208', 'n_tokens_mistral': 726, 'n_tokens_neox': 669, 'n_words': 248}