#!/bin/bash
#
# get_typemill_version - get typemill installed version
#
# ::do_not_edit::
# ::maintainer::
#
CMD=$(basename $0)
CMDVER="1.0"
CMDSTR="$CMD v$CMDSTR (2026-07-25)"

set -e -u

# (MAIN)

[ "X${PRJ:-}" = "X" ] && {
	PRJ=$(dirname "$0")
	cd "$PRJ/.."
	export PRJ=$(pwd)
}

instdir=$(cat $PRJ/etc/instdir)
file="$instdir/system/typemill/settings/defaults.yaml"
cur_version=
need_install=false

[ -f $file ] || {
	echo -e "\n$CMD: cannot get typemill version" >&2
	echo -e "	(file '$file' not found)\n" >&2
	exit 1
}


# version: '2.22.0'
grep "^version:" "$file" | sed -e 's/.* //' -e "s/'//g"
exit 0
