mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
Fix a version parsing issue when on a tagged version
This commit is contained in:
@@ -53,10 +53,14 @@ def get_sources(path, srcroot):
|
|||||||
|
|
||||||
def get_git_version():
|
def get_git_version():
|
||||||
from subprocess import run
|
from subprocess import run
|
||||||
cp = run(['git', 'describe', '--dirty', '--abbrev=7'],
|
cp = run(['git', 'describe', '--dirty'],
|
||||||
check=True, capture_output=True)
|
check=True, capture_output=True)
|
||||||
full_version = cp.stdout.decode('utf-8').strip()
|
full_version = cp.stdout.decode('utf-8').strip()
|
||||||
|
|
||||||
|
cp = run(['git', 'rev-parse', 'HEAD'],
|
||||||
|
check=True, capture_output=True)
|
||||||
|
full_sha = cp.stdout.decode('utf-8').strip()
|
||||||
|
|
||||||
dirty = False
|
dirty = False
|
||||||
parts1 = full_version.split('-')
|
parts1 = full_version.split('-')
|
||||||
if parts1[-1] == "dirty":
|
if parts1[-1] == "dirty":
|
||||||
@@ -69,7 +73,7 @@ def get_git_version():
|
|||||||
parts2[0],
|
parts2[0],
|
||||||
parts2[1],
|
parts2[1],
|
||||||
parts2[2],
|
parts2[2],
|
||||||
parts1[-1][1:],
|
full_sha[:7],
|
||||||
dirty)
|
dirty)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user