<commit_before>#!/bin/bash

set -e

if [[ ! $(type -P gox) ]]; then
    echo "Error: gox not found."
    echo "To fix: run 'go get github.com/mitchellh/gox', and/or add \$GOPATH/bin to \$PATH"
    exit 1
fi

if [[ ! $(type -P github-release) ]]; then
    echo "Error: github-release not found."
    exit 1
fi

VER=$1

if [[ -z $VER ]]; then
    echo "Need to specify version."
    exit 1
fi

git tag $VER

echo "Building $VER"
echo

gox -ldflags "-X main.version=$VER" -osarch="darwin/amd64 linux/amd64"

echo "* " > desc
echo "" >> desc

echo "$ sha1sum holen_*" >> desc
sha1sum holen_* >> desc
echo "$ sha256sum holen_*" >> desc
sha256sum holen_* >> desc
echo "$ md5sum holen_*" >> desc
md5sum holen_* >> desc

vi desc

cp bootstrap.template holen.bootstrap
perl -p -i -e "s/__VERSION__/$VER/g" holen.bootstrap
md5sum holen_* >> holen.bootstrap

git push --tags

sleep 2

github-release release --pre-release --user justone --repo holen --tag $VER --name $VER --description desc
github-release upload --user justone --repo holen --tag $VER --name holen_darwin_amd64 --file holen_darwin_amd64
github-release upload --user justone --repo holen --tag $VER --name holen_linux_amd64 --file holen_linux_amd64
github-release upload --user justone --repo holen --tag $VER --name holen.bootstrap --file holen.bootstrap<commit_msg>automatically handle pre release versions<commit_after>#!/bin/bash

set -e

if [[ ! $(type -P gox) ]]; then
    echo "Error: gox not found."
    echo "To fix: run 'go get github.com/mitchellh/gox', and/or add \$GOPATH/bin to \$PATH"
    exit 1
fi

if [[ ! $(type -P github-release) ]]; then
    echo "Error: github-release not found."
    exit 1
fi

VER=$1

if [[ -z $VER ]]; then
    echo "Need to specify version."
    exit 1
fi

PRE_ARG=
if [[ $VER =~ pre ]]; then
    PRE_ARG="--pre-release"
fi

git tag $VER

echo "Building $VER"
echo

gox -ldflags "-X main.version=$VER" -osarch="darwin/amd64 linux/amd64"

echo "* " > desc
echo "" >> desc

echo "$ sha1sum holen_*" >> desc
sha1sum holen_* >> desc
echo "$ sha256sum holen_*" >> desc
sha256sum holen_* >> desc
echo "$ md5sum holen_*" >> desc
md5sum holen_* >> desc

vi desc

cp bootstrap.template holen.bootstrap
perl -p -i -e "s/__VERSION__/$VER/g" holen.bootstrap
md5sum holen_* >> holen.bootstrap

git push --tags

sleep 2

github-release release $PRE_ARG --user justone --repo holen --tag $VER --name $VER --description desc
github-release upload --user justone --repo holen --tag $VER --name holen_darwin_amd64 --file holen_darwin_amd64
github-release upload --user justone --repo holen --tag $VER --name holen_linux_amd64 --file holen_linux_amd64
github-release upload --user justone --repo holen --tag $VER --name holen.bootstrap --file holen.bootstrap
{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.020460358056265986, 'mean_word_length': 3.278125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, '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': '4168725', 'n_tokens_mistral': 1009, 'n_tokens_neox': 957, 'n_words': 330}