mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-22 16:20:19 +01:00
Fix all warnings and errors
This commit is contained in:
parent
3460e37d82
commit
2711d6ed8b
5 changed files with 14 additions and 10 deletions
2
arrow.gd
2
arrow.gd
|
@ -7,7 +7,7 @@ var repository: Container
|
||||||
func _ready():
|
func _ready():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func _process(delta):
|
func _process(_delta):
|
||||||
if repository and repository.objects.has(target):
|
if repository and repository.objects.has(target):
|
||||||
var t = repository.objects[target]
|
var t = repository.objects[target]
|
||||||
#print(t)
|
#print(t)
|
||||||
|
|
6
main.gd
6
main.gd
|
@ -87,11 +87,11 @@ func construct_repo(script, path):
|
||||||
shell.run("mkdir " + path)
|
shell.run("mkdir " + path)
|
||||||
shell.cd(path)
|
shell.cd(path)
|
||||||
shell.run("git init")
|
shell.run("git init")
|
||||||
var output = shell.run("source "+script_path)
|
var o = shell.run("source "+script_path)
|
||||||
if game.debug:
|
if game.debug:
|
||||||
print(output)
|
print(o)
|
||||||
|
|
||||||
func _process(delta):
|
func _process(_delta):
|
||||||
if server.is_connection_available():
|
if server.is_connection_available():
|
||||||
client_connection = server.take_connection()
|
client_connection = server.take_connection()
|
||||||
read_commit_message()
|
read_commit_message()
|
||||||
|
|
4
node.gd
4
node.gd
|
@ -14,7 +14,7 @@ var arrow = preload("res://arrow.tscn")
|
||||||
func _ready():
|
func _ready():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func _process(delta):
|
func _process(_delta):
|
||||||
if held:
|
if held:
|
||||||
global_position = get_global_mouse_position()
|
global_position = get_global_mouse_position()
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ func _on_unhover():
|
||||||
$Content.visible = false
|
$Content.visible = false
|
||||||
$ID.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 is InputEventMouseButton:
|
||||||
if event.button_index == BUTTON_LEFT:
|
if event.button_index == BUTTON_LEFT:
|
||||||
held = event.pressed
|
held = event.pressed
|
||||||
|
|
|
@ -11,7 +11,7 @@ var objects = {}
|
||||||
func _ready():
|
func _ready():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func _process(delta):
|
func _process(_delta):
|
||||||
if path:
|
if path:
|
||||||
apply_forces()
|
apply_forces()
|
||||||
|
|
||||||
|
@ -184,9 +184,10 @@ func commit_parents(id):
|
||||||
|
|
||||||
func all_refs():
|
func all_refs():
|
||||||
var 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(" ")
|
line = line.split(" ")
|
||||||
var id = line[0]
|
var _id = line[0]
|
||||||
var name = line[1]
|
var name = line[1]
|
||||||
refs.push_back(name)
|
refs.push_back(name)
|
||||||
return refs
|
return refs
|
||||||
|
|
5
shell.gd
5
shell.gd
|
@ -46,9 +46,12 @@ func _exec(command, args=[]):
|
||||||
print("exec: %s [%s]" % [command, PoolStringArray(args).join(", ")])
|
print("exec: %s [%s]" % [command, PoolStringArray(args).join(", ")])
|
||||||
|
|
||||||
var output = []
|
var output = []
|
||||||
OS.execute(command, args, true, output, true)
|
var exit_code = OS.execute(command, args, true, output, true)
|
||||||
output = output[0]
|
output = output[0]
|
||||||
|
|
||||||
|
if exit_code != 0:
|
||||||
|
push_error("OS.execute failed: %s [%s] Output: %s" % [command, PoolStringArray(args).join(", "), output])
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
print(output)
|
print(output)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue