mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-07 10:59:49 +00:00
Use static methods of DirAccess in some places in HandleExtensions.gd
This commit is contained in:
parent
07d3eb4f4b
commit
0bb6d1ddf5
|
@ -67,15 +67,13 @@ func _ready() -> void:
|
||||||
|
|
||||||
func install_extension(path: String) -> void:
|
func install_extension(path: String) -> void:
|
||||||
var file_name := path.get_file()
|
var file_name := path.get_file()
|
||||||
var dir := DirAccess.open(path.get_base_dir())
|
var dir := DirAccess.copy_absolute(path, EXTENSIONS_PATH.path_join(file_name))
|
||||||
dir.copy(path, EXTENSIONS_PATH.path_join(file_name))
|
|
||||||
_add_extension(file_name)
|
_add_extension(file_name)
|
||||||
|
|
||||||
|
|
||||||
func _uninstall_extension(file_name := "", remove_file := true, item := extension_selected) -> void:
|
func _uninstall_extension(file_name := "", remove_file := true, item := extension_selected) -> void:
|
||||||
if remove_file:
|
if remove_file:
|
||||||
var dir := DirAccess.open(EXTENSIONS_PATH.path_join(file_name))
|
var err := DirAccess.remove_absolute(EXTENSIONS_PATH.path_join(file_name))
|
||||||
var err := dir.remove(EXTENSIONS_PATH.path_join(file_name))
|
|
||||||
if err != OK:
|
if err != OK:
|
||||||
print(err)
|
print(err)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue