#!/bin/sh
set -eu

version=$( head -n 1 ../NEWS )
case "$version" in
    Bower*) ;;
    *)
	echo "unexpected first line in NEWS file" >&2
	version="unknown"
	;;
esac

cat >prog_version.m <<EOF
% This file is automatically generated.

:- module prog_version.
:- interface.

:- func version_string = string.

:- implementation.

version_string = "${version}".
EOF
