mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-24 16:20:08 +01:00
Fix a few bugs related to execution on Windows
This commit is contained in:
parent
0fb30e99ec
commit
06063d5ee6
3 changed files with 4 additions and 3 deletions
|
@ -27,7 +27,8 @@ func _ready():
|
||||||
|
|
||||||
func _input(event):
|
func _input(event):
|
||||||
if event.is_action_pressed("save"):
|
if event.is_action_pressed("save"):
|
||||||
save()
|
if text_edit.visible:
|
||||||
|
save()
|
||||||
|
|
||||||
func clear():
|
func clear():
|
||||||
for item in grid.get_children():
|
for item in grid.get_children():
|
||||||
|
|
2
shell.gd
2
shell.gd
|
@ -60,7 +60,7 @@ func run(command, crash_on_fail=true):
|
||||||
# On Windows, if the command contains a newline (even if inside a string),
|
# On Windows, if the command contains a newline (even if inside a string),
|
||||||
# execution will end. To avoid that, we first write the command to a file,
|
# execution will end. To avoid that, we first write the command to a file,
|
||||||
# and run that file with bash.
|
# and run that file with bash.
|
||||||
var script_path = game.tmp_prefix_inside + "command"
|
var script_path = game.tmp_prefix_inside + "command" + str(randi())
|
||||||
helpers.write_file(script_path, hacky_command)
|
helpers.write_file(script_path, hacky_command)
|
||||||
result = helpers.exec(_shell_binary(), [script_path], crash_on_fail)
|
result = helpers.exec(_shell_binary(), [script_path], crash_on_fail)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -43,8 +43,8 @@ func save():
|
||||||
text += "\n"
|
text += "\n"
|
||||||
|
|
||||||
helpers.write_file(fixme_path+path, text)
|
helpers.write_file(fixme_path+path, text)
|
||||||
emit_signal("saved")
|
|
||||||
close()
|
close()
|
||||||
|
emit_signal("saved")
|
||||||
|
|
||||||
func close():
|
func close():
|
||||||
if _client_connection and _client_connection.is_connected_to_host():
|
if _client_connection and _client_connection.is_connected_to_host():
|
||||||
|
|
Loading…
Reference in a new issue