<commit_before>#!/usr/bin/env bash
### Terminate script on error
set -e

### Global vars
TMP_BASE_DIR="fusion-templates";

### declare an array of template names
declare -a templates=(
    "template-drawer-navigation"
    "template-tab-navigation"
    "template-master-detail"
    "template-blank"
    "template-drawer-navigation-ts"
    "template-master-detail-ts"
    "template-blank-ts"
    "template-tab-navigation-ts"
    "template-drawer-navigation-ng"
    "template-tab-navigation-ng"
    "template-master-detail-ng"
    "template-blank-ng"
)

### Check PWD
function checkDir() {
    if [[ ${PWD} != *${TMP_BASE_DIR}* ]]; then
        echo "Please run the script from the ${TMP_BASE_DIR} directory";
        exit 1;
    else
        echo ${PWD};
    fi
}

### Main function
function run() {
TMP_BASE=$(checkDir)
for i in "${templates[@]}"
do
    cd "${TMP_BASE}/${i}";
    echo "Downloading the latest changes from the ${i} repository"
    git checkout master && git pull
done;

}

checkDir
run
exit 0;

#TEST=$(checkDir)
#
#echo "Result ${TEST}"<commit_msg>Added colors to console output<commit_after>#!/usr/bin/env bash
### Terminate script on error
set -e

### Global vars
TMP_BASE_DIR="fusion-templates";

GREEN='\033[0;32m'
WHITE='\033[1;37m'
RED='\033[0;31m'
NC='\033[0m' # No Color

### declare an array of template names
declare -a templates=(
    "template-drawer-navigation"
    "template-tab-navigation"
    "template-master-detail"
    "template-blank"
    "template-drawer-navigation-ts"
    "template-master-detail-ts"
    "template-blank-ts"
    "template-tab-navigation-ts"
    "template-drawer-navigation-ng"
    "template-tab-navigation-ng"
    "template-master-detail-ng"
    "template-blank-ng"
)

### Check PWD
function checkDir() {
    if [[ ${PWD} != *${TMP_BASE_DIR}* ]]; then
        echo -e "${RED}Please run the script from your ${WHITE}${TMP_BASE_DIR}${RED} directory ${NC}";
        exit 1;
    else
        echo ${PWD};
    fi
}

### Main function
function run() {
TMP_BASE=$(checkDir)
for i in "${templates[@]}"
do
    cd "${TMP_BASE}/${i}";
    echo -e "${GREEN}Downloading the latest changes from the ${WHITE}${i}${GREEN} repository${NC}"
    git checkout master && git pull
done;

}

checkDir
run
exit 0;

#TEST=$(checkDir)
#
#echo "Result ${TEST}"
{'fraction_non_alphanumeric': 0.16426387068588905, 'fraction_numerical': 0.011358671909130624, 'mean_word_length': 3.5078740157480315, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5164753', 'n_tokens_mistral': 811, 'n_tokens_neox': 795, 'n_words': 192}