diff --git a/project.godot b/project.godot index 36c069d..1c44147 100644 --- a/project.godot +++ b/project.godot @@ -10,7 +10,7 @@ config_version=5 [application] -config/name="Godot Dir Utils" +config/name="Godot_Dir_Utils" config/features=PackedStringArray("4.2", "GL Compatibility") config/icon="res://icon.svg" diff --git a/src/DirUtils.gd b/src/DirUtils.gd index f3181d6..c95ac43 100644 --- a/src/DirUtils.gd +++ b/src/DirUtils.gd @@ -8,6 +8,7 @@ #-- #-- Anticipated changes: #-- - Rewrite get_files_names to use the very simple get_files_at method. +#-- - Update delete_dir to call delete_dir if it finds a dir inside the path. #-- #-- Portability issue: #-- - All the path have to be absolute (res:// and user:// work though)! @@ -15,6 +16,7 @@ #-- Changelog: #-- - 06/08/2024 Lyaaaaa #-- - Renamed cut_file into move_file to be more explicit. +#-- #------------------------------------------------------------------------------ @tool class_name Dir_Utils diff --git a/tests/test_dir_utils.gd b/tests/test_dir_utils.gd index c077126..8f95a09 100644 --- a/tests/test_dir_utils.gd +++ b/tests/test_dir_utils.gd @@ -35,6 +35,11 @@ #-- #-- - 06/08/2024 Lyaaaaa #-- - Renamed cut_file into move_file. +#-- +#-- - 07/08/2024 Lyaaaaa +#-- - Updated test_delete to delete all the files declared in files +#-- (forgot to update it when added a fourth file in files var). +#-- - Updated test_get_folder_size to correctly do its job and to clean his mess. #------------------------------------------------------------------------------ extends GutTest @@ -96,6 +101,7 @@ func test_delete(): Dir_Utils.delete(test_folder + sub_folders[0] + files[1]) Dir_Utils.delete(test_folder + sub_folders[0] + files[2]) + Dir_Utils.delete(test_folder + sub_folders[0] + files[3]) result = Dir_Utils.delete((test_folder + sub_folders[0])) assert_true(result, "Did delete return true for deleting a folder.") @@ -167,7 +173,7 @@ func test_delete_dir(): func test_get_folder_size(): - var size = Dir_Utils.get_folder_size(test_folder) + var size = Dir_Utils.get_folder_size(test_folder + sub_folders[0]) var msg = "get folder size returns an int" assert_typeof(size, TYPE_INT, msg) @@ -184,6 +190,8 @@ func test_is_empty() -> void: assert_true(Dir_Utils.is_empty(path)) assert_false(Dir_Utils.is_empty(test_folder.path_join(sub_folders[0]))) + Dir_Utils.delete_dir(path) + func test_get_file_name_with_extension() -> void: var path = test_folder.path_join(sub_folders[0].path_join(files[2]))