From 814572e1a1c6e12ab9fbe0f6009265c23b57efae Mon Sep 17 00:00:00 2001 From: walon Date: Tue, 26 Aug 2025 21:17:03 +0800 Subject: [PATCH] [fix] fix the bug that BashUtil.CopyDir calls UnityEditor.FileUtil.CopyFileOrDirectory failed when parent directory of dst does not exist. --- Editor/Installer/BashUtil.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Editor/Installer/BashUtil.cs b/Editor/Installer/BashUtil.cs index 1a20c96..1685469 100644 --- a/Editor/Installer/BashUtil.cs +++ b/Editor/Installer/BashUtil.cs @@ -108,7 +108,15 @@ namespace HybridCLR.Editor.Installer { UnityEngine.Debug.Log($"[BashUtil] CopyDir {src} => {dst}"); } - RemoveDir(dst); + if (Directory.Exists(dst)) + { + RemoveDir(dst); + } + else + { + string parentDir = Path.GetDirectoryName(Path.GetFullPath(dst)); + Directory.CreateDirectory(parentDir); + } UnityEditor.FileUtil.CopyFileOrDirectory(src, dst); }