mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-12 00:02:53 +00:00
Commit hash as version
This commit is contained in:
parent
5f0adc0f10
commit
7c1ee20e7b
@ -4,8 +4,14 @@ import subprocess
|
||||
FILENAME_VERSION_H = 'src/version.h'
|
||||
version = os.environ.get('GITHUB_TAG')
|
||||
if version == None:
|
||||
result = subprocess.run(['git','rev-parse','--short','HEAD'], stdout=subprocess.PIPE)
|
||||
version = result.stdout.decode('utf-8').strip()
|
||||
try:
|
||||
result = subprocess.run(['git','rev-parse','--short','HEAD'], capture_output=True, check=False)
|
||||
if result.returncode == 0:
|
||||
version = result.stdout.decode('utf-8').strip()
|
||||
else:
|
||||
version = "SNAPSHOT"
|
||||
except:
|
||||
version = "SNAPSHOT"
|
||||
|
||||
import datetime
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user