From dd15c88585ebfea599b83e93763bd400aef09172 Mon Sep 17 00:00:00 2001 From: Rob Kelly Date: Sun, 12 Jan 2025 22:49:56 -0700 Subject: [PATCH] Revised debug version overlay to only try populating advanced info when running from editor --- src/util/debug_version_info.gd | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/util/debug_version_info.gd b/src/util/debug_version_info.gd index faac1e2..1eff431 100644 --- a/src/util/debug_version_info.gd +++ b/src/util/debug_version_info.gd @@ -9,14 +9,16 @@ func _ready() -> void: # Fall back on baked version info text = Game.settings.version - var output: Array[String] = [] - var status := OS.execute("git", ["describe", "--always", "HEAD"], output) - if status == 0: - text = output[0].strip_edges() + # Try to expand on version number if running from the editor + if OS.has_feature("editor"): + var output: Array[String] = [] + var status := OS.execute("git", ["describe", "--always", "HEAD"], output) + if status == 0: + text = output[0].strip_edges() - output = [] - status = OS.execute("git", ["branch", "--show-current"], output) - if status == 0: - var branch_name := output[0].strip_edges() - if branch_name and not branch_name in IGNORED_BRANCHES: - text += " (%s)" % branch_name + output = [] + status = OS.execute("git", ["branch", "--show-current"], output) + if status == 0: + var branch_name := output[0].strip_edges() + if branch_name and not branch_name in IGNORED_BRANCHES: + text += " (%s)" % branch_name