<commit_before>#!/usr/bin/env bash

set -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd $DIR/..

source $DIR/bootstrap_for_flashing.sh

CYGWIN_PACKAGES="make, gcc-core, patchutils, git, unzip, python, check, curl, libsasl2, python-setuptools"

if [ $OS == "windows" ]; then
    die "Sorry, the bootstrap script for compiling from source doesn't support the Windows console - try Cygwin."
fi

if [ $OS == "mac" ] && ! command -v brew >/dev/null 2>&1; then
    echo "Installing Homebrew..."
    ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
fi

if ! command -v make >/dev/null 2>&1; then
    if [ $OS == "cygwin" ]; then
        _cygwin_error "make"
    elif [ $OS == "mac" ]; then
            die "Missing 'make' - install the Xcode CLI tools"
    else
        if [ $DISTRO == "arch" ]; then
            $SUDO_CMD pacman -S base-devel
        elif [ $DISTRO == "Ubuntu" ]; then
            $SUDO_CMD apt-get update -qq
            $SUDO_CMD apt-get install build-essential -y
        fi
    fi
fi

if ! command -v git >/dev/null 2>&1; then
    if [ $OS == "cygwin" ]; then
        _cygwin_error "git"
    elif [ $OS == "mac" ] || [ $OS == "linux" ]; then
        _install git
    fi
fi

echo "Updating Git submodules..."

# git submodule update is a shell script and expects some lines to fail
set +e
git submodule sync
if ! git submodule update --init --recursive --quiet; then
    echo "Unable to update git submodules - try running \"git submodule update --init --recursive\" to see the full error"<commit_msg>Recommend installing Git with official installer in Windows.<commit_after>#!/usr/bin/env bash

set -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd $DIR/..

source $DIR/bootstrap_for_flashing.sh

CYGWIN_PACKAGES="make, gcc-core, patchutils, unzip, python, check, curl, libsasl2, python-setuptools"

if [ $OS == "windows" ]; then
    die "Sorry, the bootstrap script for compiling from source doesn't support the Windows console - try Cygwin."
fi

if [ $OS == "mac" ] && ! command -v brew >/dev/null 2>&1; then
    echo "Installing Homebrew..."
    ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
fi

if ! command -v make >/dev/null 2>&1; then
    if [ $OS == "cygwin" ]; then
        _cygwin_error "make"
    elif [ $OS == "mac" ]; then
            die "Missing 'make' - install the Xcode CLI tools"
    else
        if [ $DISTRO == "arch" ]; then
            $SUDO_CMD pacman -S base-devel
        elif [ $DISTRO == "Ubuntu" ]; then
            $SUDO_CMD apt-get update -qq
            $SUDO_CMD apt-get install build-essential -y
        fi
    fi
fi

if ! command -v git >/dev/null 2>&1; then
    if [ $OS == "cygwin" ]; then
        die "You need to install Git for Windows from http://git-scm.com/ and select the option to \"Run Git from the Windows Command Prompt\" during the installation."
    elif [ $OS == "mac" ] || [ $OS == "linux" ]; then
        _install git
    fi
fi

echo "Updating Git submodules..."

# git submodule update is a shell script and expects some lines to fail
set +e
git submodule sync
if ! git submodule update --init --recursive --quiet; then
    echo "Unable to update git submodules - try running \"git submodule update --init --recursive\" to see the full error"
{'fraction_non_alphanumeric': 0.13568147013782542, 'fraction_numerical': 0.004900459418070444, 'mean_word_length': 2.641025641025641, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5789385', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1063, 'n_words': 394}