<commit_before>CLOUDFIER_URL=${CLOUDFIER_URL:-http://develop.cloudfier.com}

if [ "$#" -lt 2 ] ; then
    echo 'Parameters PLATFORM and APPLICATION are required'
    exit 1
fi

PLATFORM=$1
APPLICATION=$2
CLOUDFIER_USER=${3:-test}

echo Generating $APPLICATION on $PLATFORM 

rm -Rf $PLATFORM/$APPLICATION/gen
mkdir -p $PLATFORM/$APPLICATION/gen
wget -v -d  $CLOUDFIER_URL/services/generator/$CLOUDFIER_USER-cloudfier-examples-$APPLICATION/platform/$PLATFORM  -O generated.zip
if [ $? -ne 0 ] ; then 
    exit 1
fi
unzip -d $PLATFORM/$APPLICATION/gen generated.zip
rm -Rf generated.zip<commit_msg>allow generating for apps stored anywhere<commit_after>CLOUDFIER_URL=${CLOUDFIER_URL:-http://develop.cloudfier.com}

if [ "$#" -lt 2 ] ; then
    echo 'Parameters PLATFORM and APPLICATION are required'
    exit 1
fi

PLATFORM=$1
APPLICATION=$2
CLOUDFIER_USER=${3:-test}
BASE_APPLICATION_PATH=${4:-cloudfier-examples}
APPLICATION_URL=$CLOUDFIER_URL/services/generator/$CLOUDFIER_USER-${BASE_APPLICATION_PATH//\//-}-$APPLICATION

echo "Generating $APPLICATION on $PLATFORM (hosted at $APPLICATION_URL)"

rm -Rf $PLATFORM/$APPLICATION/gen
mkdir -p $PLATFORM/$APPLICATION/gen
wget -v -d  $APPLICATION_URL/platform/$PLATFORM  -O generated.zip
if [ $? -ne 0 ] ; then 
    exit 1
fi
unzip -d $PLATFORM/$APPLICATION/gen generated.zip
rm -Rf generated.zip
{'fraction_non_alphanumeric': 0.12965722801788376, 'fraction_numerical': 0.011177347242921014, 'mean_word_length': 4.763948497854077, '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': '2899961', 'n_tokens_mistral': 522, 'n_tokens_neox': 497, 'n_words': 107}