<commit_before># --- build all four currently published builds of liblouis (UTF-16 with
#     tables, UTF-16 wihout tables, UTF-32 with tables and UTF-32  without
#     tables) in a docker image that has all necessary build tools installed.
rm -f ../js-build/build-*.js

echo "[liblouis-js] starting docker image with emscripten installed..."
docker run -v $(pwd):/src dolp/liblouis-js-build-travis:1.37.3-64bit /bin/bash -c "./.travis/script/emscripten-build.sh"

if [ $? != 0 ]; then
        echo "[liblouis-js] Build failed. Aborting..."
        exit 1
fi

# --- collect all files that are necessary for a publish in package
#     managers.
echo "[liblouis-js] bundling files to package for publish..." &&
rm -rf ../js-build/tables/ &&
cp -R ./tables/ ../js-build/tables/ &&
cp -Rf ./out/* ../js-build/

if [ -n "$BUILD_VERSION" ]; then
	cd ../js-build
	npm version --no-git-tag-version $BUILD_VERSION
	cd -
fi

ls -lah ../js-build

# --- make sure the package we just build is not damaged.
echo "[liblouis-js] testing builds..."
<commit_msg>Discard docker container after build<commit_after># --- build all four currently published builds of liblouis (UTF-16 with
#     tables, UTF-16 wihout tables, UTF-32 with tables and UTF-32  without
#     tables) in a docker image that has all necessary build tools installed.
rm -f ../js-build/build-*.js

echo "[liblouis-js] starting docker image with emscripten installed..."
docker run --rm -v $(pwd):/src dolp/liblouis-js-build-travis:1.37.3-64bit /bin/bash -c "./.travis/script/emscripten-build.sh"

if [ $? != 0 ]; then
        echo "[liblouis-js] Build failed. Aborting..."
        exit 1
fi

# --- collect all files that are necessary for a publish in package
#     managers.
echo "[liblouis-js] bundling files to package for publish..." &&
rm -rf ../js-build/tables/ &&
cp -R ./tables/ ../js-build/tables/ &&
cp -Rf ./out/* ../js-build/

if [ -n "$BUILD_VERSION" ]; then
	cd ../js-build
	npm version --no-git-tag-version $BUILD_VERSION
	cd -
fi

ls -lah ../js-build

# --- make sure the package we just build is not damaged.
echo "[liblouis-js] testing builds..."

{'fraction_non_alphanumeric': 0.15203021718602455, 'fraction_numerical': 0.015108593012275733, 'mean_word_length': 2.7175438596491226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4772000', 'n_tokens_mistral': 751, 'n_tokens_neox': 709, 'n_words': 251}