diff --git a/arrow.gd b/arrow.gd index 0415efe..c38ac30 100644 --- a/arrow.gd +++ b/arrow.gd @@ -7,7 +7,7 @@ var repository: Container func _ready(): pass -func _process(delta): +func _process(_delta): if repository and repository.objects.has(target): var t = repository.objects[target] #print(t) diff --git a/main.gd b/main.gd index a508f7d..c1695fb 100644 --- a/main.gd +++ b/main.gd @@ -87,11 +87,11 @@ func construct_repo(script, path): shell.run("mkdir " + path) shell.cd(path) shell.run("git init") - var output = shell.run("source "+script_path) + var o = shell.run("source "+script_path) if game.debug: - print(output) + print(o) -func _process(delta): +func _process(_delta): if server.is_connection_available(): client_connection = server.take_connection() read_commit_message() diff --git a/node.gd b/node.gd index c93715f..766ab8a 100644 --- a/node.gd +++ b/node.gd @@ -14,7 +14,7 @@ var arrow = preload("res://arrow.tscn") func _ready(): pass -func _process(delta): +func _process(_delta): if held: global_position = get_global_mouse_position() @@ -83,7 +83,7 @@ func _on_unhover(): $Content.visible = false $ID.visible = false -func _input_event(viewport, event, shape_idx): +func _input_event(_viewport, event, _shape_idx): if event is InputEventMouseButton: if event.button_index == BUTTON_LEFT: held = event.pressed diff --git a/repository.gd b/repository.gd index cd53c9f..5da5de7 100644 --- a/repository.gd +++ b/repository.gd @@ -11,7 +11,7 @@ var objects = {} func _ready(): pass -func _process(delta): +func _process(_delta): if path: apply_forces() @@ -184,9 +184,10 @@ func commit_parents(id): func all_refs(): var refs = [] - for line in git("show-ref", true): + # If there are no refs, show-ref will have exit code 1. We don't care. + for line in git("show-ref || true", true): line = line.split(" ") - var id = line[0] + var _id = line[0] var name = line[1] refs.push_back(name) return refs diff --git a/shell.gd b/shell.gd index 9e67ea3..564370f 100644 --- a/shell.gd +++ b/shell.gd @@ -46,9 +46,12 @@ func _exec(command, args=[]): print("exec: %s [%s]" % [command, PoolStringArray(args).join(", ")]) var output = [] - OS.execute(command, args, true, output, true) + var exit_code = OS.execute(command, args, true, output, true) output = output[0] + if exit_code != 0: + push_error("OS.execute failed: %s [%s] Output: %s" % [command, PoolStringArray(args).join(", "), output]) + if debug: print(output)