Skip to content

Commit

Permalink
fix SemVer definition
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed Dec 13, 2023
1 parent 40c00cb commit 6a3c179
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions installation/includes/02_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@ get_version_string() {
local version_minor
local version_patch

version_major=$(grep 'VERSION_MAJOR\s*=\s*[0-9]*' "${python_file}" | awk -F= '{print $2}' | tr -d ' ')
version_minor=$(grep 'VERSION_MINOR\s*=\s*[0-9]*' "${python_file}" | awk -F= '{print $2}' | tr -d ' ')
version_patch=$(grep 'VERSION_PATCH\s*=\s*[0-9]*' "${python_file}" | awk -F= '{print $2}' | tr -d ' ')
version_major=$(grep -o 'VERSION_MAJOR\s*=\s*[0-9]*' "${python_file}" | awk -F= '{print $2}' | tr -d ' ')
version_minor=$(grep -o 'VERSION_MINOR\s*=\s*[0-9]*' "${python_file}" | awk -F= '{print $2}' | tr -d ' ')
version_patch=$(grep -o 'VERSION_PATCH\s*=\s*[0-9]*' "${python_file}" | awk -F= '{print $2}' | tr -d ' ')
version_extra=$(grep -o 'VERSION_EXTRA\s*=\s*\".*\"' "${python_file}" | awk -F= '{print $2}' | tr -d ' "')

if [ -n "$version_major" ] && [ -n "$version_minor" ] && [ -n "$version_patch" ]; then
local version_string="${version_major}.${version_minor}.${version_patch}"
if [ -n "$version_extra" ]; then
version_string="${version_string}-${version_extra}"
fi
echo ${version_string}
else
exit_on_error "ERROR: Unable to extract version information from ${python_file}"
Expand Down
2 changes: 1 addition & 1 deletion src/jukebox/jukebox/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
__version_info__ = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)

if VERSION_EXTRA:
__version__ = "%s.%s" % (__version__, VERSION_EXTRA)
__version__ = "%s-%s" % (__version__, VERSION_EXTRA)
__version_info__ = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_EXTRA)


Expand Down

0 comments on commit 6a3c179

Please sign in to comment.