mirror of
https://github.com/mozilla/DeepSpeech.git
synced 2025-10-26 11:19:39 +00:00
19 lines
329 B
Bash
Executable File
19 lines
329 B
Bash
Executable File
#!/bin/sh
|
|
|
|
GIT_DIR="$(realpath "$(dirname "$(realpath "$0")")/../.git/")"
|
|
if [ ! -d "${GIT_DIR}" ]; then
|
|
return 1
|
|
fi;
|
|
|
|
GIT_VERSION=$(git --git-dir="${GIT_DIR}" describe --long --tags)
|
|
if [ $? -ne 0 ]; then
|
|
GIT_VERSION=unknown;
|
|
fi
|
|
|
|
cat <<EOF
|
|
#include <string>
|
|
const char* ds_git_version() {
|
|
return "${GIT_VERSION}";
|
|
}
|
|
EOF
|