#!/bin/sh

# This allow to set the default path, if script used outside makefile
if [ -z "$OUT_PATH" ]; then
    OUT_PATH="./build/out/distribution"
fi

# if no environment argument, set to default value dev
if [ -z "$1" ]; then
    ENV="dev"
else
    ENV="$1"
fi

if COMMIT_MSG=$(QUANTEX_ENVIRONMENT=$ENV "${OUT_PATH}/qfixpt" -v 2>/dev/null); then
    echo "$COMMIT_MSG"
else
    echo "Unable to get qfixpt version."
    file "${OUT_PATH}/qfixpt"
fi

