浏览代码

fix: config-importer error when output dir empty

LanzaSchneider 1 年之前
父节点
当前提交
35fb24612d
共有 1 个文件被更改,包括 3 次插入2 次删除
  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():