From d352bd24c26f7c20f3761d83d139a995e7c083b2 Mon Sep 17 00:00:00 2001 From: Sebastian Morr Date: Wed, 9 Sep 2020 11:01:30 +0200 Subject: [PATCH] Look at the OS to decide which shell binary to run --- shell.gd | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/shell.gd b/shell.gd index 8ac8ff9..853df9b 100644 --- a/shell.gd +++ b/shell.gd @@ -33,12 +33,23 @@ func run(command): hacky_command += "cd '%s';" % _cwd hacky_command += command - var output = _exec("/bin/sh", ["-c", hacky_command]) + var output = _exec(_shell_binary(), ["-c", hacky_command]) if debug: print(output) return output + +func _shell_binary(): + var os = OS.get_name() + + if os == "X11": + return "/bin/sh" + elif os == "Windows": + return "external/git_bash.exe" + else: + push_error("Unsupported OS") + get_tree().quit() var _t func run_async(command):