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

set -eux

ROOT=$(cd $(dirname $0) ; pwd)
TARGET=$1
IMAGE=snoyberg/stackage:$(echo $TARGET | cut -d- -f 1)

if [ "$IMAGE" -eq "nightly"]
then
    TROOT=$ROOT/nightly
else
    TROOT=$ROOT/$(echo $TARGET | cut -d. -f 1)
fi

PLAN_FILE=current-plan.yaml
BUNDLE_FILE=current.bundle

CABAL_DIR=$ROOT/cabal
GHC_DIR=$ROOT/ghc
DOT_STACKAGE_DIR=$ROOT/dot-stackage
WORKDIR=$TROOT/work
SSH_DIR=$ROOT/ssh-$(echo $TARGET | cut -d- -f 1)

mkdir -p \
	"$CABAL_DIR" \
	"$GHC_DIR" \
	"$DOT_STACKAGE_DIR" \
	"$WORKDIR" \
	"$SSH_DIR"

GITCONFIG=$ROOT/gitconfig
cat >$GITCONFIG <<EOF
[user]
	email = <EMAIL>
	name = Stackage Build host
EOF<commit_msg>Fix working directory for nightly<commit_after>#!/usr/bin/env bash

set -eux

ROOT=$(cd $(dirname $0) ; pwd)
TARGET=$1
TAG=$(echo $TARGET | cut -d- -f 1)
IMAGE=snoyberg/stackage:$TAG

if [ "$TAG" -eq "nightly"]
then
    TROOT=$ROOT/nightly
else
    TROOT=$ROOT/$(echo $TARGET | cut -d. -f 1)
fi

PLAN_FILE=current-plan.yaml
BUNDLE_FILE=current.bundle

CABAL_DIR=$ROOT/cabal
GHC_DIR=$ROOT/ghc
DOT_STACKAGE_DIR=$ROOT/dot-stackage
WORKDIR=$TROOT/work
SSH_DIR=$ROOT/ssh-$(echo $TARGET | cut -d- -f 1)

mkdir -p \
	"$CABAL_DIR" \
	"$GHC_DIR" \
	"$DOT_STACKAGE_DIR" \
	"$WORKDIR" \
	"$SSH_DIR"

GITCONFIG=$ROOT/gitconfig
cat >$GITCONFIG <<EOF
[user]
	email = <EMAIL>
	name = Stackage Build host
EOF
{'fraction_non_alphanumeric': 0.17391304347826086, 'fraction_numerical': 0.007369196757553427, 'mean_word_length': 4.223076923076923, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '463972', 'n_tokens_mistral': 624, 'n_tokens_neox': 620, 'n_words': 124}