<commit_before><commit_msg>Productivity: Create createScreen.sh<commit_after>#!/bin/bash

if [ $# -eq 0 ]; then
    echo "Usage: ./createScreen.sh MyScreen [subFolder]"
    exit 1
fi 

SCREEN_NAME=$1
SCREEN_VAR_NAME=`echo $SCREEN_NAME | awk '{ print tolower(substr($0, 1, 1)) substr($0, 2) }'`

MODULE_DIR="../../Riot/Modules"

OUTPUT_DIR="$MODULE_DIR"
if [ $# -eq 2 ]; 
then
    OUTPUT_DIR="$OUTPUT_DIR/$1"
    if [ ! -e $OUTPUT_DIR ]; then
        echo "Create folder ${OUTPUT_DIR}"
        mkdir $OUTPUT_DIR
    fi 
    
    OUTPUT_DIR="$OUTPUT_DIR/$2"
else
    OUTPUT_DIR="$OUTPUT_DIR/$1"
fi


if [ -e $OUTPUT_DIR ]; then
    echo "Error: Folder ${OUTPUT_DIR} already exists"
    exit 1
fi 

echo "Create folder ${OUTPUT_DIR}"

cp -R buildable/ScreenTemplate $OUTPUT_DIR

cd $OUTPUT_DIR
for file in *
do
    echo "Building ${file/TemplateScreen/$SCREEN_NAME}..."
    perl -p -i -e "s/TemplateScreen/"$SCREEN_NAME"/g" $file
    perl -p -i -e "s/templateScreen/"$SCREEN_VAR_NAME"/g" $file
    mv ${file} ${file/TemplateScreen/$SCREEN_NAME}
done
{'fraction_non_alphanumeric': 0.15583173996175909, 'fraction_numerical': 0.0124282982791587, 'mean_word_length': 3.4553191489361703, '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': '6488083', 'n_tokens_mistral': 403, 'n_tokens_neox': 385, 'n_words': 93}