<commit_before>#!/bin/bash

PATH=$GOPATH/bin/:$PATH
VERSION=$1
TIME=$(date +%s)

if [ -z "$VERSION" ]; then
	echo "You must call this script with a version as first argument"
	exit 1
fi

cd ui/src && gulp && cd ../../

rm -rf build
mkdir build

go-bindata -prefix ui/build ui/build/...

function make_release() {
	NAME=$1
	export GOOS=$2
	export GOARCH=$3
	SUFFIX=$4
	RELEASE_PATH=build/gohls-$NAME-${VERSION}
	RELEASE_FILE=gohls-$NAME-${VERSION}.tar.gz
	mkdir $RELEASE_PATH
	cp README.md $RELEASE_PATH
	cp LICENSE.txt $RELEASE_PATH
	echo $GOOS
	echo $GOARCH
	cat buildinfo.go.in | sed "s/##VERSION##/${VERSION}/g" | sed "s/##COMMIT##/$(git rev-parse HEAD)/g" | sed "s/##BUILD_TIME##/$TIME/g" > buildinfo.go
	go build -o $RELEASE_PATH/gohls${SUFFIX} *.go
	PREV_WD=$(PWD)
	cd  $RELEASE_PATH
	tar cvfz ../$RELEASE_FILE .
	cd ../../
}

make_release "osx" "darwin" "amd64" ""
make_release "linux-386" "linux" "386" ""
make_release "linux-amd64" "linux" "amd64" ""
make_release "windows-amd64" "windows" "amd64" ".exe"<commit_msg>Fixed release script<commit_after>#!/bin/bash

PATH=$GOPATH/bin/:$PATH
VERSION=$1
TIME=$(date +%s)

if [ -z "$VERSION" ]; then
	echo "You must call this script with a version as first argument"
	exit 1
fi

cd ui/src && npm run build && cd ../../

rm -rf build
mkdir build

go-bindata -prefix ui/build ui/build/...

function make_release() {
	NAME=$1
	export GOOS=$2
	export GOARCH=$3
	SUFFIX=$4
	RELEASE_PATH=build/gohls-$NAME-${VERSION}
	RELEASE_FILE=gohls-$NAME-${VERSION}.tar.gz
	mkdir $RELEASE_PATH
	cp README.md $RELEASE_PATH
	cp LICENSE.txt $RELEASE_PATH
	echo $GOOS
	echo $GOARCH
	cat buildinfo.go.in | sed "s/##VERSION##/${VERSION}/g" | sed "s/##COMMIT##/$(git rev-parse HEAD)/g" | sed "s/##BUILD_TIME##/$TIME/g" > buildinfo.go
	go build -o $RELEASE_PATH/gohls${SUFFIX} *.go
	PREV_WD=$(PWD)
	cd  $RELEASE_PATH
	tar cvfz ../$RELEASE_FILE .
	cd ../../
}

make_release "osx" "darwin" "amd64" ""
make_release "linux-386" "linux" "386" ""
make_release "linux-amd64" "linux" "amd64" ""
make_release "windows-amd64" "windows" "amd64" ".exe"
{'fraction_non_alphanumeric': 0.1819941916747338, 'fraction_numerical': 0.021297192642787996, 'mean_word_length': 4.078624078624078, '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': '5413553', 'n_tokens_mistral': 873, 'n_tokens_neox': 817, 'n_words': 201}