<commit_before>#!/usr/bin/env zsh

set -eu

echo "Setup composer configs"

composer_dir="${HOME}/.composer"

echo "Create the ${composer_dir} directory"
mkdir -p ${composer_dir}

echo "Install the composer global package"
if type "php" > /dev/null 2>&1; then
    composer g install
else
    echo "php command does not exist!"
    echo "Skip the composer global install."
fi<commit_msg>Update composer setup script<commit_after>#!/usr/bin/env zsh

set -eu

echo "Setup composer configs"

COMPOSER_BIN_INSTALL_DIR=`realpath ~/bin-local`
COMPOSER_BIN=`realpath ${COMPOSER_BIN_INSTALL_DIR}/composer`
COMPOSER_BIN_FILENAME=`basename ${COMPOSER_BIN}`

if type "php" > /dev/null 2>&1; then
    if [ -e ${COMPOSER_BIN} ]; then
        echo "Run composer self update"
        ${COMPOSER_BIN} self-update
    else
        echo "Download composer binary"
        mkdir -p ${COMPOSER_BIN_INSTALL_DIR}
        curl -sS https://getcomposer.org/installer | php -- --install-dir=${COMPOSER_BIN_INSTALL_DIR} --filename=${COMPOSER_BIN_FILENAME}
    fi

    echo "Install composer global packages"
    ${COMPOSER_BIN} g install
else
    echo "php command does not exist."
    echo "Skip setup composer configs."
fi
{'fraction_non_alphanumeric': 0.11213389121338913, 'fraction_numerical': 0.0033472803347280333, 'mean_word_length': 3.8421052631578947, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '885846', 'n_tokens_mistral': 410, 'n_tokens_neox': 394, 'n_words': 115}