<commit_before>#!/bin/bash

TEMP_DIR="/tmp"
BASE_DIR=${TEMP_DIR}/$(ctx execution-id)
NODEJS_ROOT=${BASE_DIR}/nodejs

ctx logger info "Changing directory to ${BASE_DIR}"
cd ${BASE_DIR} || exit $?

YUM_CMD=$(which yum)
APT_GET_CMD=$(which apt-get)

ctx logger info "Downloading application sources to ${BASE_DIR}"
if [ -f nodecellar ]; then
    ctx logger info "Application sources already exists, skipping"   
else
    if [[ ! -z $YUM_CMD ]]; then
        sudo yum -y install git-core || exit $?   
    elif [[ ! -z $APT_GET_CMD ]]; then 
        sudo apt-get -qq install git || exit $?   
     else
        ctx logger error "error can't install package git"
        exit 1;
     fi

    git_url=$(ctx node properties git_url)
    git_branch=$(ctx node properties git_branch)

    ctx logger info "cloning application from git url ${git_url}" 
    git clone ${git_url} || exit $?
    cd nodecellar || exit $?
    if [[ ! -z $git_branch ]]; then
        ctx logger info "checking out branch ${git_branch}" 
        git checkout ${git_branch} || exit $?
    fi 
    ctx logger info "Installing application modules using npm" 
    ${NODEJS_ROOT}/nodejs/bin/npm install --silent || exit $?
fi<commit_msg>Update install-app.sh<commit_after>#!/bin/bash

TEMP_DIR="/tmp"
BASE_DIR=${TEMP_DIR}/$(ctx execution-id)
NODEJS_ROOT=${BASE_DIR}/nodejs

ctx logger info "Changing directory to ${BASE_DIR}"
cd ${BASE_DIR} || exit $?

YUM_CMD=$(which yum)
APT_GET_CMD=$(which apt-get)

ctx logger info "Downloading application sources to ${BASE_DIR}"
if [ -f nodecellar ]; then
    ctx logger info "Application sources already exists, skipping"   
else
    if [[ ! -z $YUM_CMD ]]; then
        sudo yum -y install git-core || exit $?   
    elif [[ ! -z $APT_GET_CMD ]]; then 
        sudo apt-get -qq install git || exit $?   
     else
        ctx logger error "error can't install package git"
        exit 1;
     fi

    git_url=$(ctx node properties git_url)
    git_branch=$(ctx node properties git_branch)

    ctx logger info "cloning application from git url ${git_url}" 
    if [[ ! -z "$git_branch" ]]; then
        git clone ${git_url} || exit $?
    else 
        ctx logger info "checking out branch ${git_branch}" 
       git clone -b ${git_branch} ${git_url} || exit $?
    fi
    
    cd nodecellar || exit $?
    if [[ ! -z $git_branch ]]; then
        ctx logger info "checking out branch ${git_branch}" 
        git checkout ${git_branch} || exit $?
    fi 
    ctx logger info "Installing application modules using npm" 
    ${NODEJS_ROOT}/nodejs/bin/npm install --silent || exit $?
fi
{'fraction_non_alphanumeric': 0.125241592578276, 'fraction_numerical': 0.0007730962504831851, 'mean_word_length': 2.933130699088146, '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': '2203667', 'n_tokens_mistral': 850, 'n_tokens_neox': 814, 'n_words': 269}