mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-03 19:04:40 +01:00
Look at the OS to decide which shell binary to run
This commit is contained in:
parent
040dae1ab0
commit
d352bd24c2
1 changed files with 12 additions and 1 deletions
13
shell.gd
13
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):
|
||||
|
|
Loading…
Reference in a new issue