2020-11-02 13:13:04 +01:00
|
|
|
extends Node
|
|
|
|
class_name ShellCommand
|
|
|
|
|
|
|
|
signal done
|
|
|
|
|
|
|
|
var command
|
|
|
|
var output
|
|
|
|
var exit_code
|
|
|
|
var crash_on_fail = true
|
2020-11-02 15:19:52 +01:00
|
|
|
var thread
|
2023-09-07 11:43:51 +02:00
|
|
|
var js_callback # For JavaScriptBridge
|
2020-11-10 22:37:10 +01:00
|
|
|
|
|
|
|
func _unused():
|
|
|
|
# This is just to suppress a warning about the signal never being emitted.
|
|
|
|
emit_signal("done")
|
2023-09-07 11:43:51 +02:00
|
|
|
|
|
|
|
func callback(_output):
|
|
|
|
#print(_output)
|
|
|
|
output = _output[0]
|
2023-09-08 15:23:48 +02:00
|
|
|
print("output of async command (" + command + "): >>"+output+"<<" )
|
2023-09-07 11:43:51 +02:00
|
|
|
exit_code = 0
|
|
|
|
emit_signal("done")
|