From 2fc78f3e99f6ff5dbfd706727ee9dc1e872c0a3a Mon Sep 17 00:00:00 2001 From: blinry Date: Thu, 11 Feb 2021 11:54:09 +0100 Subject: [PATCH] Display a nice error screen if Git is not installed --- scenes/game.gd | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scenes/game.gd b/scenes/game.gd index 08cdaa0..aec4040 100644 --- a/scenes/game.gd +++ b/scenes/game.gd @@ -22,11 +22,15 @@ func _ready(): game.toggle_music() global_shell = Shell.new() - - create_file_in_game_env(".gitconfig", helpers.read_file("res://scripts/gitconfig")) - - copy_script_to_game_env("fake-editor") - copy_script_to_game_env("hint") + + if global_shell.run("command -v git &>/dev/null && echo yes || echo no") == "no\n": + game.skipped_title = true + get_tree().change_scene("res://scenes/no_git.tscn") + else: + create_file_in_game_env(".gitconfig", helpers.read_file("res://scripts/gitconfig")) + + copy_script_to_game_env("fake-editor") + copy_script_to_game_env("hint") load_state()