generated from krampus/template-godot4
Revised debug version overlay to only try populating advanced info when running from editor
This commit is contained in:
parent
4854fd0aab
commit
dd15c88585
@ -9,14 +9,16 @@ func _ready() -> void:
|
|||||||
# Fall back on baked version info
|
# Fall back on baked version info
|
||||||
text = Game.settings.version
|
text = Game.settings.version
|
||||||
|
|
||||||
var output: Array[String] = []
|
# Try to expand on version number if running from the editor
|
||||||
var status := OS.execute("git", ["describe", "--always", "HEAD"], output)
|
if OS.has_feature("editor"):
|
||||||
if status == 0:
|
var output: Array[String] = []
|
||||||
text = output[0].strip_edges()
|
var status := OS.execute("git", ["describe", "--always", "HEAD"], output)
|
||||||
|
if status == 0:
|
||||||
|
text = output[0].strip_edges()
|
||||||
|
|
||||||
output = []
|
output = []
|
||||||
status = OS.execute("git", ["branch", "--show-current"], output)
|
status = OS.execute("git", ["branch", "--show-current"], output)
|
||||||
if status == 0:
|
if status == 0:
|
||||||
var branch_name := output[0].strip_edges()
|
var branch_name := output[0].strip_edges()
|
||||||
if branch_name and not branch_name in IGNORED_BRANCHES:
|
if branch_name and not branch_name in IGNORED_BRANCHES:
|
||||||
text += " (%s)" % branch_name
|
text += " (%s)" % branch_name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user