<commit_before>#Setup script for running Chronos
#@author: <NAME>
#@license: GPLv3 license


##VARIABLES
VERBOSE=1
DEBUG=0
##END

function msg() {
	 #filter for messages
	 if [ $1 == "e" ]
	 then
	     # "!!!" red and blinking
	     echo -e "\e[5m\e[31m !!!\e[0m\e[25m $2"
	 fi

	 if [ $1 == "v" -a $VERBOSE -eq 1 ]
	 then
	     echo -e "\e[92m ***\e[0m $2"
	 fi

	 if [ $1 == "d" -a $DEBUG -eq 1 ]
	 then
	     echo -e "\e[33m @@@\e[0m $2"
	 fi  
}

function get_npm_dependences() {

    msg v "Installing npm dependences"
    msg d "Getting Electron..."
    npm install electron-prebuilt -g
    msg d "Getting Typings..."
    npm install typings -g
    msg d "Getting Async..."
    npm install async
    msg d "Getting posix-getopt"
    npm install posix-getopt
}

function get_node() {

    msg v "You need sudo privileges in order to do this operation"
    msg d "Refreshing apt cache..."
    apt-get update -qq
    msg d "Installing nodeJs..."
    apt-get install nodejs-legacy nodejs -y -qq
    msg v "Done installing nodeJs"
}

function main() {

    echo "IMPORTANT: you need to run this script in the Chronos folder. If you moved it, press Ctrl-C and stop the execution. Waiting 3 seconds..."
    sleep 3

    if [ "$1" == "-n" ]
    then
	msg d "Getting NodeJs"
	get_node
    fi

    msg d "Getting npm dependences..."
    get_npm_dependences

    msg d "Setting typings"
    typings install node --ambient
}

#first error everything stops
set -e
#main call<commit_msg>Compilation start when finished the installation<commit_after>#Setup script for running Chronos
#@author: <NAME>
#@license: GPLv3 license


##VARIABLES
VERBOSE=1
DEBUG=0
##END

function msg() {
	 #filter for messages
	 if [ $1 == "e" ]
	 then
	     # "!!!" red and blinking
	     echo -e "\e[5m\e[31m !!!\e[0m\e[25m $2"
	 fi

	 if [ $1 == "v" -a $VERBOSE -eq 1 ]
	 then
	     echo -e "\e[92m ***\e[0m $2"
	 fi

	 if [ $1 == "d" -a $DEBUG -eq 1 ]
	 then
	     echo -e "\e[33m @@@\e[0m $2"
	 fi  
}

function get_npm_dependences() {

    msg v "Installing npm dependences"
    msg d "Getting Electron..."
    npm install electron-prebuilt -g
    msg d "Getting Typings..."
    npm install typings -g
    msg d "Getting Async..."
    npm install async
    msg d "Getting posix-getopt"
    npm install posix-getopt
}

function get_node() {

    msg v "You need sudo privileges in order to do this operation"
    msg d "Refreshing apt cache..."
    apt-get update -qq
    msg d "Installing nodeJs..."
    apt-get install nodejs-legacy nodejs -y -qq
    msg v "Done installing nodeJs"
}

function main() {

    echo "IMPORTANT: you need to run this script in the Chronos folder. If you moved it, press Ctrl-C and stop the execution. Waiting 3 seconds..."
    sleep 3

    if [ "$1" == "-n" ]
    then
	msg d "Getting NodeJs"
	get_node
    fi

    msg d "Getting npm dependences..."
    get_npm_dependences

    msg d "Setting typings"
    cd src/
    typings install node --ambient
    #compile project
    tsc
    #move to the root project
    cd ../ 
}

#first error everything stops
set -e
#main call
{'fraction_non_alphanumeric': 0.12093628088426528, 'fraction_numerical': 0.016905071521456438, 'mean_word_length': 2.4150943396226414, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1704735', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1057, 'n_words': 405}