Jelajahi Sumber

fix: config-importer error when output dir empty

LanzaSchneider 1 tahun lalu
induk
melakukan
35fb24612d
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      editor/config-importer.tscn

+ 3 - 2
editor/config-importer.tscn

@@ -72,8 +72,9 @@ class ConfigField:
 
 func _on_import_perform_button_down() -> void:
 	var full_output_path := ProjectSettings.globalize_path($output_path.text)
-	OS.move_to_trash(full_output_path)
-	DirAccess.make_dir_absolute(full_output_path)
+	if DirAccess.dir_exists_absolute(full_output_path):
+		OS.move_to_trash(full_output_path)
+	DirAccess.make_dir_recursive_absolute(full_output_path)
 	_setup_task(func():
 		var dir_access := DirAccess.open($config_path.text)
 		for config_type in dir_access.get_directories():