<commit_before>#!/bin/bash

set -e
#set -v

THIS_SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# ---------------------
# Install SDK
# ---------------------
INSTALLED_SDK=$(brew ls --versions pebble-sdk)
if [[ $INSTALLED_SDK ]]; then
    echo "$INSTALLED_SDK already installed => skipping 'brew install'"
else
    # iterate over environment variables, e.g. pebbe_without_emulator and construct SDK_OPTIONS
    SDK_OPTIONS=""
    for option in emulator freetype node; do
        option_arg="sdk_without_$option"
        if [ "${!option_arg}" == "yes" ]; then
            SDK_OPTIONS="$SDK_OPTIONS--without-$option "
        fi
    done

    # make brew aware of pebble-qemu
    brew tap pebble/pebble-sdk

    echo "Installing pebbke-sdk with options: $SDK_OPTIONS"
    # TODO: replace local homebrew recipe with public one once the PR landed
    #   https://github.com/pebble/homebrew-pebble-sdk/pull/46
    cmd="brew install $THIS_SCRIPTDIR/pebble-sdk.rb $SDK_OPTIONS"
    eval $cmd

    if [ "$sdk_analytics_enabled" == "yes" ]; then
        echo "SDK analytics enabled"
        analytics_file="ENABLE_ANALYTICS"
    else
        echo "SDK analytics disabled"
        analytics_file="NO_TRACKING"
    fi
    touch "$HOME/Library/Application Support/Pebble SDK/$analytics_file"

    # TODO: download specific SDK version
fi

# ---------------------
# Build Project
# ---------------------
if [[ $project_path ]]; then
  echo "Pebble project configured at $project_path"
  pushd "$project_path"
  pebble build
  popd
else
  echo "No path for Pebble project specified => skipping build"
fi<commit_msg>on the CI system, the "Application Support/Pebble SDK" doesn't exist when we want to touch the required file<commit_after>#!/bin/bash

set -e
#set -v

THIS_SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# ---------------------
# Install SDK
# ---------------------
INSTALLED_SDK=$(brew ls --versions pebble-sdk)
if [[ $INSTALLED_SDK ]]; then
    echo "$INSTALLED_SDK already installed => skipping 'brew install'"
else
    # iterate over environment variables, e.g. pebbe_without_emulator and construct SDK_OPTIONS
    SDK_OPTIONS=""
    for option in emulator freetype node; do
        option_arg="sdk_without_$option"
        if [ "${!option_arg}" == "yes" ]; then
            SDK_OPTIONS="$SDK_OPTIONS--without-$option "
        fi
    done

    # make brew aware of pebble-qemu
    brew tap pebble/pebble-sdk

    echo "Installing pebbke-sdk with options: $SDK_OPTIONS"
    # TODO: replace local homebrew recipe with public one once the PR landed
    #   https://github.com/pebble/homebrew-pebble-sdk/pull/46
    cmd="brew install $THIS_SCRIPTDIR/pebble-sdk.rb $SDK_OPTIONS"
    eval $cmd

    if [ "$sdk_analytics_enabled" == "yes" ]; then
        echo "SDK analytics enabled"
        analytics_file="ENABLE_ANALYTICS"
    else
        echo "SDK analytics disabled"
        analytics_file="NO_TRACKING"
    fi
    mkdir -p "$HOME/Library/Application Support/Pebble SDK"
    touch "$HOME/Library/Application Support/Pebble SDK/$analytics_file"

    # TODO: download specific SDK version
fi

# ---------------------
# Build Project
# ---------------------
if [[ $project_path ]]; then
  echo "Pebble project configured at $project_path"
  pushd "$project_path"
  pebble build
  popd
else
  echo "No path for Pebble project specified => skipping build"
fi
{'fraction_non_alphanumeric': 0.15107701386839775, 'fraction_numerical': 0.0017704337562702863, 'mean_word_length': 2.7089715536105032, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '4747400', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1041, 'n_words': 297}