<commit_before>#!/bin/bash -eu

scriptDir=$(dirname $(readlink -f $0))

if [[ $# -eq 0 || $1 == "--help" || $1 == "-h" ]] ; then
    helpMsg=$scriptDir/help.txt
    cat $helpMsg
    exit 0
fi

cookbookDir=$1
recipeName=$2

sandboxDir=$PWD/.sandbox/
sandboxCookbooksDir=$sandboxDir/cookbooks/

function prepareSandbox() {
    mkdir -p $sandboxCookbooksDir
}

function versionBerks() {
    cd $cookbookDir
    berks vendor $sandboxCookbooksDir/
}

function runCapsuledRecipe() {
    cd $sandboxDir
    chef-client -z -o $recipeName
}

function runRecipe() {
    prepareSandbox
    versionBerks
    runCapsuledRecipe
}

function runRecipeClean() {
    (runRecipe && cleanupSandbox) \
	|| cleanupSandbox<commit_msg>Rename .sandbox hidden directory to chef_one_sandbox to avoid potential name conflict with other applications<commit_after>#!/bin/bash -eu

scriptDir=$(dirname $(readlink -f $0))

if [[ $# -eq 0 || $1 == "--help" || $1 == "-h" ]] ; then
    helpMsg=$scriptDir/help.txt
    cat $helpMsg
    exit 0
fi

cookbookDir=$1
recipeName=$2

sandboxDir=$PWD/.chef_one_sandbox/
sandboxCookbooksDir=$sandboxDir/cookbooks/

function prepareSandbox() {
    mkdir -p $sandboxCookbooksDir
}

function versionBerks() {
    cd $cookbookDir
    berks vendor $sandboxCookbooksDir/
}

function runCapsuledRecipe() {
    cd $sandboxDir
    chef-client -z -o $recipeName
}

function runRecipe() {
    prepareSandbox
    versionBerks
    runCapsuledRecipe
}

function runRecipeClean() {
    (runRecipe && cleanupSandbox) \
	|| cleanupSandbox
{'fraction_non_alphanumeric': 0.12639161755075312, 'fraction_numerical': 0.0091683038637852, 'mean_word_length': 3.7899686520376177, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2789383', 'n_tokens_mistral': 583, 'n_tokens_neox': 540, 'n_words': 120}