<commit_before>#!/bin/bash

scriptPath=$(pwd)
labPath="$scriptPath/vendor/cspray/labrador"
projectName=$1

# Check to make sure that there is at least some project name given
if [ -z "$projectName" ]
then
    echo "You must provide a valid project name to get started"
    exit 255
fi

if [ ! -d "$labPath" ]
then
    echo "Labrador could not be found at ./vendor/cspray/labrador...ABORTING!"
    exit 255
fi

echo "Creating new Labrador project named $projectName"
echo

dirs=("$scriptPath/src/$projectName" "$scriptPath/public" "$scriptPath/config")

for item in "${dirs[@]}"
    do
        if [ -d "$item" ]
        then
            echo "$item already exists ... skipping"
        else
            if [ -w "$item" ]
            then
                echo "WARNING! $item is not writable ... skipping"
            else
                echo "Creating $item ... "
                mkdir -p "$item"
            fi
        fi
    done

echo "Copying over configuration and setup files..."

cp "$labPath/init.php" "$scriptPath/init.php"
cp "$labPath/LICENSE" "$scriptPath/LICENSE"
cp "$labPath/phpunit.xml.dist" "$scriptPath/phpunit.xml.dist"
cp "$labPath/config/master_config.php" "$scriptPath/config/master_config.php"
cp "$labPath/config/bootstraps.php" "$scriptPath/config/bootstraps.php"
cp "$labPath/config/services.php" "$scriptPath/config/services.php"
cp "$labPath/config/routes.php" "$scriptPath/config/routes.php"
cp "$labPath/public/index.php" "$scriptPath/public/index.php"

echo
echo "Finished creating your project!"


<commit_msg>adding conditionals so as not to overwrite config<commit_after>#!/bin/bash

scriptPath=$(pwd)
labPath="$scriptPath/vendor/cspray/labrador"
projectName=$1

# Check to make sure that there is at least some project name given
if [ -z "$projectName" ]
then
    echo "You must provide a valid project name to get started"
    exit 255
fi

if [ ! -d "$labPath" ]
then
    echo "Labrador could not be found at ./vendor/cspray/labrador ... ABORTING!"
    exit 255
fi

echo "Creating new Labrador project named $projectName"
echo

dirs=("$scriptPath/src/$projectName" "$scriptPath/public" "$scriptPath/config")

for item in "${dirs[@]}"
    do
        if [ -d "$item" ]
        then
            echo "$item already exists ... skipping"
        else
            if [ -w "$item" ]
            then
                echo "WARNING! $item is not writable ... skipping"
            else
                echo "Creating $item ... "
                mkdir -p "$item"
            fi
        fi
    done

echo "Copying over configuration and setup files..."

if [ -f "$scriptPath/init.php" ]
then
    echo "$scriptPath/init.php already exists ... skipping"
else
    cp "$labPath/init.php" "$scriptPath/init.php"
fi

if [ -f "$scriptPath/LICENSE" ]
then
    echo "$scriptPath/LICENSE already exists ... skipping"
else
    cp "$labPath/LICENSE" "$scriptPath/LICENSE"
fi

if [ -f "$scriptPath/phpunit.xml.dist" ]
then
    echo "$scriptPath/phpunit.xml.dist already exists ... skipping"
else
   cp "$labPath/phpunit.xml.dist" "$scriptPath/phpunit.xml.dist"
fi

if [ -f "$scriptPath/config/master_config.php" ]
then
    echo "$scriptPath/config/master_config.php already exists ... skipping"
else
    cp "$labPath/config/master_config.php" "$scriptPath/config/master_config.php"
fi

if [ -f "$scriptPath/config/bootstraps.php" ]
then
    echo "$scriptPath/config/bootstraps.php already exists ... skipping"
else
    cp "$labPath/config/bootstraps.php" "$scriptPath/config/bootstraps.php"
fi

if [ -f "$scriptPath/config/services.php" ]
then
    echo "$scriptPath/config/services.php already exists ... skipping"
else
    cp "$labPath/config/services.php" "$scriptPath/config/services.php"
fi

if [ -f "$scriptPath/config/routes.php" ]
then
    echo "$scriptPath/config/routes.php already exists ... skipping"
else
    cp "$labPath/config/routes.php" "$scriptPath/config/routes.php"
fi

if [ -f "$scriptPath/public/index.php" ]
then
    echo "$scriptPath/public/inxed.php already exists ... skipping"
else
    cp "$labPath/public/index.php" "$scriptPath/public/index.php"
fi

echo
echo "Finished creating your project!"
{'fraction_non_alphanumeric': 0.13355915799661264, 'fraction_numerical': 0.003387369949189451, 'mean_word_length': 2.903682719546742, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '3591566', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1296, 'n_words': 364}