<commit_before>#!/bin/bash
##############################################################################################
## Build script for Factorio docker server, runs in cronjob and updates
## docker hub with new versions as they are released
##############################################################################################

DOCKER_IMAGE="koshatul/factorio"

BASE_DIR="$(cd $(dirname ${0})/..; pwd)"
echo "INFO Base Directory: ${BASE_DIR}"
BUILD_DONE="0"

function docker_tag_exists() {
	curl --silent -f -lSL https://index.docker.io/v1/repositories/$1/tags/$2 > /dev/null
}

function docker_build_factorio() {
	VERSION="${1}"
	RELEASE_URL="${2}"
	if docker_tag_exists "${DOCKER_IMAGE}" "${VERSION}"; then
		echo "INFO Skipping, already on Docker Hub"
		return;
	fi
	BUILD_DONE="1"
	BUILD_DIR="$(mktemp -d)"
	echo "INFO Build Directory: ${BUILD_DIR}"
	cp ${BASE_DIR}/Dockerfile ${BUILD_DIR}/Dockerfile<commit_msg>Linux build compatibility<commit_after>#!/bin/bash
##############################################################################################
## Build script for Factorio docker server, runs in cronjob and updates
## docker hub with new versions as they are released
##############################################################################################

DOCKER_IMAGE="koshatul/factorio"

BASE_DIR="$(cd $(dirname ${0})/..; pwd)"
echo "INFO Base Directory: ${BASE_DIR}"
BUILD_DONE="0"
BIN_REVERSE_ORDER="tail -r"
if [[ "$(which tac)" != "" ]]; then
	BIN_REVERSE_ORDER="$(which tac)"
fi

function docker_tag_exists() {
	curl --silent -f -lSL https://index.docker.io/v1/repositories/$1/tags/$2 > /dev/null
}

function docker_build_factorio() {
	VERSION="${1}"
	RELEASE_URL="${2}"
	if docker_tag_exists "${DOCKER_IMAGE}" "${VERSION}"; then
		echo "INFO Skipping, already on Docker Hub"
		return;
	fi
	BUILD_DONE="1"
	BUILD_DIR="$(mktemp -d)"
	echo "INFO Build Directory: ${BUILD_DIR}"
	cp ${BASE_DIR}/Dockerfile ${BUILD_DIR}/Dockerfile
{'fraction_non_alphanumeric': 0.3220253164556962, 'fraction_numerical': 0.00810126582278481, 'mean_word_length': 6.841269841269841, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '4685548', 'n_tokens_mistral': 642, 'n_tokens_neox': 582, 'n_words': 148}