mirror of
https://github.com/wassname/TTS.git
synced 2026-10-28 12:41:20 +08:00
if git is not available set git has 'unknown'
This commit is contained in:
1 parent
d9c405f0c3
commit
1ac99ce0d0
1 file changed
+3
-1
@@ -15,6 +15,8 @@ def get_git_branch():
|
||||
current.replace("* ", "")
|
||||
except subprocess.CalledProcessError:
|
||||
current = "inside_docker"
|
||||
except FileNotFoundError:
|
||||
current = "unknown"
|
||||
return current
|
||||
|
||||
|
||||
@@ -30,7 +32,7 @@ def get_commit_hash():
|
||||
commit = subprocess.check_output(
|
||||
['git', 'rev-parse', '--short', 'HEAD']).decode().strip()
|
||||
# Not copying .git folder into docker container
|
||||
except subprocess.CalledProcessError:
|
||||
except (subprocess.CalledProcessError, FileNotFoundError):
|
||||
commit = "0000000"
|
||||
print(' > Git Hash: {}'.format(commit))
|
||||
return commit
|
||||
|
||||
Reference in new issue
Block a user