diff --git a/repository.gd b/repository.gd index 9398003..a07d42a 100644 --- a/repository.gd +++ b/repository.gd @@ -69,12 +69,13 @@ func set_path(new_path): path = new_path if path_node: path_node.text = path - shell.cd(new_path) - for o in objects.values(): - o.queue_free() - objects = {} - if is_inside_tree(): - update_everything() + if new_path != "": + shell.cd(new_path) + for o in objects.values(): + o.queue_free() + objects = {} + if is_inside_tree(): + update_everything() func get_path(): return path diff --git a/sandbox.gd b/sandbox.gd index b06fca3..069489e 100644 --- a/sandbox.gd +++ b/sandbox.gd @@ -26,3 +26,8 @@ func _ready(): $Columns/Repository.path = path get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_2D, SceneTree.STRETCH_ASPECT_KEEP, Vector2(1920, 1080), 1.5) + + $Columns/Terminal.repository = $Columns/Repository + +func update_repo(): + $Columns/Repository.update_everything() diff --git a/sandbox.tscn b/sandbox.tscn index 910bb5b..a6d25d5 100644 --- a/sandbox.tscn +++ b/sandbox.tscn @@ -49,3 +49,4 @@ margin_left = 961.0 margin_right = 1910.0 margin_bottom = 1070.0 size_flags_horizontal = 3 +[connection signal="command_done" from="Columns/Terminal" to="." method="update_repo"]