mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-22 16:20:19 +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,13 +33,24 @@ func run(command):
|
||||||
hacky_command += "cd '%s';" % _cwd
|
hacky_command += "cd '%s';" % _cwd
|
||||||
hacky_command += command
|
hacky_command += command
|
||||||
|
|
||||||
var output = _exec("/bin/sh", ["-c", hacky_command])
|
var output = _exec(_shell_binary(), ["-c", hacky_command])
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
print(output)
|
print(output)
|
||||||
|
|
||||||
return 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
|
var _t
|
||||||
func run_async(command):
|
func run_async(command):
|
||||||
_t = Thread.new()
|
_t = Thread.new()
|
||||||
|
|
Loading…
Reference in a new issue