<commit_before>#!/bin/bash
set -eo pipefail

mode="$1"
put_url="$2"

build_root=/tmp/source
cache_root=/tmp/cache
buildpack_root=/tmp/buildpacks

if [[ "$mode" == "stream" ]]; then
	slug_file="-"
else
	slug_file=/tmp/slug.tgz
fi

mkdir -p $cache_root
mkdir -p $buildpack_root
mkdir -p $build_root/.profile.d

function mode_redirect() {
	if [[ "$mode" == "stream" ]]; then
		cat - 1>&2
	else
		cat -
	fi
}

function echo_title() {
  echo $'\e[1G----->' $* | mode_redirect
}

function echo_normal() {
  echo $'\e[1G      ' $* | mode_redirect
}

function ensure_indent() {
  while read line; do
    if [[ "$line" == --* ]]; then
      echo $'\e[1G'$line | mode_redirect
    else
      echo $'\e[1G      ' "$line" | mode_redirect
    fi

  done 
}

## Load source from STDIN

cat | tar -xC $build_root

## Buildpack detection

buildpacks=($buildpack_root/*)
selected_buildpack=

if [[ -n "$BUILDPACK_URL" ]]; then
	echo_title "Fetching custom buildpack"

	buildpack="$buildpack_root/custom"
	rm -fr "$buildpack"<commit_msg>taking us back<commit_after>#!/bin/bash
set -eo pipefail

mode="$1"
put_url="$2"

build_root=/tmp/source
cache_root=/tmp/cache
buildpack_root=/tmp/buildpacks

if [[ "$mode" == "stream" ]]; then
	slug_file="-"
else
	slug_file=/tmp/slug.tgz
fi

mkdir -p $cache_root
mkdir -p $buildpack_root
mkdir -p $build_root/.profile.d

function mode_redirect() {
	if [[ "$mode" == "stream" ]]; then
		cat - 1>&2
	else
		cat -
	fi
}

function echo_title() {
  echo $'\e[1G----->' $* | mode_redirect
}

function echo_normal() {
  echo $'\e[1G      ' $* | mode_redirect
}

function ensure_indent() {
  while read line; do
    if [[ "$line" == --* ]]; then
      echo $'\e[1G'$line | mode_redirect
    else
      echo $'\e[1G      ' "$line" | mode_redirect
    fi

  done 
}

## Completely unnecessary hack that's necessary right now
echo -e '#!/bin/sh\nexit' > $buildpack_root/heroku-buildpack-python/vendor/bpwatch/bpwatch

## Load source from STDIN

cat | tar -xC $build_root

## Buildpack detection

buildpacks=($buildpack_root/*)
selected_buildpack=

if [[ -n "$BUILDPACK_URL" ]]; then
	echo_title "Fetching custom buildpack"

	buildpack="$buildpack_root/custom"
	rm -fr "$buildpack"
{'fraction_non_alphanumeric': 0.1658291457286432, 'fraction_numerical': 0.007309273640931932, 'mean_word_length': 3.515463917525773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '5475375', 'n_tokens_mistral': 866, 'n_tokens_neox': 840, 'n_words': 192}