1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Use static methods of DirAccess in some places in HandleExtensions.gd

This commit is contained in:
Emmanouil Papadeas 2023-09-08 20:57:25 +03:00
parent 07d3eb4f4b
commit 0bb6d1ddf5

View file

@ -67,15 +67,13 @@ func _ready() -> void:
func install_extension(path: String) -> void:
var file_name := path.get_file()
var dir := DirAccess.open(path.get_base_dir())
dir.copy(path, EXTENSIONS_PATH.path_join(file_name))
var dir := DirAccess.copy_absolute(path, EXTENSIONS_PATH.path_join(file_name))
_add_extension(file_name)
func _uninstall_extension(file_name := "", remove_file := true, item := extension_selected) -> void:
if remove_file:
var dir := DirAccess.open(EXTENSIONS_PATH.path_join(file_name))
var err := dir.remove(EXTENSIONS_PATH.path_join(file_name))
var err := DirAccess.remove_absolute(EXTENSIONS_PATH.path_join(file_name))
if err != OK:
print(err)
return