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

set -eo

mkdir -p build
mkdir -p build/commits/
mkdir -p build/pr/

echo '
  darwin   amd64    OS X
  freebsd  386      FreeBSD 32-bit
  freebsd  amd64    FreeBSD 64-bit
  linux    386      Linux 32-bit
  linux    amd64    Linux 64-bit
  windows  386      Windows 32-bit
  windows  amd64    Windows 64-bit
' | {
  while read os arch label; do
    [ -n "$os" ] || continue
    export GIMME_OS="$os"
    export GIMME_ARCH="$arch"

    BASENAME="rack-${os}-${arch}"
    RACKBUILD="build/${BASENAME}"

    SUFFIX=""
    if [ "$os" == "windows" ]; then
      SUFFIX=".exe"
    fi

    # Create build/rack
    go build -o $RACKBUILD

    # See http://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
    # for details about default Travis Environment Variables and their values
    if [ -z "$TRAVIS_BRANCH" ]; then
      BRANCH=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
      cp $RACKBUILD build/${BASENAME}-${BRANCH}${SUFFIX}
    else
      # Ship a PR binary
      if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
        cp $RACKBUILD build/pr/${BASENAME}-pr${TRAVIS_PULL_REQUEST}${SUFFIX}
      fi

      BRANCH=$TRAVIS_BRANCH
    fi

    # Provide a commit hash version
    COMMIT=`git rev-parse HEAD 2> /dev/null`
    cp $RACKBUILD build/commits/${BASENAME}-${COMMIT}${SUFFIX}

    if [ "$BRANCH" != "master" ]; then
      # Ship /rack-branchname
      cp $RACKBUILD build/${BASENAME}-${BRANCH}${SUFFIX}
      # Remove our artifact
      rm $RACKBUILD
    else if [ "$os" == "windows" ]; then
      cp $RACKBUILD $RACKBUILD${SUFFIX}
      rm $RACKBUILD
    fi

  done
}<commit_msg>Stick commits in their own folder.<commit_after>#!/usr/bin/env bash

set -eo

mkdir -p build
mkdir -p build/pr/

# Provide a commit hash version
COMMIT=`git rev-parse HEAD 2> /dev/null`
mkdir -p "build/commits/${COMMIT}"

echo '
  darwin   amd64    OS X
  freebsd  386      FreeBSD 32-bit
  freebsd  amd64    FreeBSD 64-bit
  linux    386      Linux 32-bit
  linux    amd64    Linux 64-bit
  windows  386      Windows 32-bit
  windows  amd64    Windows 64-bit
' | {
  while read os arch label; do
    [ -n "$os" ] || continue
    export GIMME_OS="$os"
    export GIMME_ARCH="$arch"

    BASENAME="rack-${os}-${arch}"
    RACKBUILD="build/${BASENAME}"

    SUFFIX=""
    if [ "$os" == "windows" ]; then
      SUFFIX=".exe"
    fi

    # Create build/rack
    go build -o $RACKBUILD

    # See http://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
    # for details about default Travis Environment Variables and their values
    if [ -z "$TRAVIS_BRANCH" ]; then
      BRANCH=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
      cp $RACKBUILD build/${BASENAME}-${BRANCH}${SUFFIX}
    else
      # Ship a PR binary
      if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
        cp $RACKBUILD build/pr/${BASENAME}-pr${TRAVIS_PULL_REQUEST}${SUFFIX}
      fi

      BRANCH=$TRAVIS_BRANCH
    fi

    cp $RACKBUILD build/commits/${COMMIT}/${BASENAME}-${COMMIT}${SUFFIX}

    if [ "$BRANCH" != "master" ]; then
      # Ship /rack-branchname
      cp $RACKBUILD build/${BASENAME}-${BRANCH}${SUFFIX}
      # Remove our artifact
      rm $RACKBUILD
    else if [ "$os" == "windows" ]; then
      cp $RACKBUILD $RACKBUILD${SUFFIX}
      rm $RACKBUILD
    fi

  done
}
{'fraction_non_alphanumeric': 0.14007782101167315, 'fraction_numerical': 0.01855731816821311, 'mean_word_length': 2.5141955835962144, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1757419', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1191, 'n_words': 303}