~geb/numen

846bd6ee59226d90d49f57b653386a67584593fe — John Gebbie 10 months ago 77931c9
deprecate /usr/local/share/vosk-models
3 files changed, 11 insertions(+), 4 deletions(-)

M build.sh
M get-model.sh
M numen.go
M build.sh => build.sh +8 -1
@@ 6,7 6,7 @@
: "${NUMEN_DEFAULT_PHRASES_DIR=/etc/numen/phrases}"
: "${NUMEN_SCRIPTS_DIR=/etc/numen/scripts}"
: "${NUMEN_DEFAULT_MODEL_PACKAGE=vosk-model-small-en-us}"
: "${NUMEN_DEFAULT_MODEL_PATHS=/usr/local/share/vosk-models/small-en-us /usr/share/vosk-models/small-en-us}"
: "${NUMEN_DEFAULT_MODEL_PATHS=/usr/share/vosk-models/small-en-us}"

if [ "$*" != '' ] && [ "$*" != install ]; then
	echo bad usage


@@ 39,4 39,11 @@ else
	mkdir -p "$NUMEN_DESTDIR/usr/share/man/man1" || exit
	scdoc < doc/numen.1.scd > "$NUMEN_DESTDIR/usr/share/man/man1/numen.1" || exit
	echo Installed Successfully.

	if [ -e /usr/local/share/vosk-models/small-en-us ]; then
		echo '
NOTE /usr/local/share/vosk-models/small-en-us is deprecated.
To move it:
mv -T /usr/local/share/vosk-models/small-en-us /usr/share/vosk-models/small-en-us'
	fi
fi

M get-model.sh => get-model.sh +2 -2
@@ 24,7 24,7 @@ if ! [ "$1" ]; then
	echo Downloaded successfully.
else
	unzip -qo "$f.zip" || exit
	mkdir -p /usr/local/share/vosk-models || exit
	mv -T "$f" "/usr/local/share/vosk-models/$name" || exit
	mkdir -p /usr/share/vosk-models || exit
	mv -T "$f" "/usr/share/vosk-models/$name" || exit
	echo Installed successfully.
fi

M numen.go => numen.go +1 -1
@@ 21,7 21,7 @@ import (
var (
	Version             string
	DefaultModelPackage = "vosk-model-small-en-us"
	DefaultModelPaths   = "/usr/local/share/vosk-models/small-en-us /usr/share/vosk-models/small-en-us"
	DefaultModelPaths   = "/usr/share/vosk-models/small-en-us"
	DefaultPhrasesDir   = "/etc/numen/phrases"
)