Fix a few bugs related to execution on Windows

This commit is contained in:
Sebastian Morr 2020-10-26 08:36:38 -07:00
parent 0fb30e99ec
commit 06063d5ee6
3 changed files with 4 additions and 3 deletions

View file

@ -27,7 +27,8 @@ func _ready():
func _input(event):
if event.is_action_pressed("save"):
save()
if text_edit.visible:
save()
func clear():
for item in grid.get_children():

View file

@ -60,7 +60,7 @@ func run(command, crash_on_fail=true):
# 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,
# 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)
result = helpers.exec(_shell_binary(), [script_path], crash_on_fail)
else:

View file

@ -43,8 +43,8 @@ func save():
text += "\n"
helpers.write_file(fixme_path+path, text)
emit_signal("saved")
close()
emit_signal("saved")
func close():
if _client_connection and _client_connection.is_connected_to_host():