mirror of
https://github.com/focus-creative-games/hybridclr_unity.git
synced 2026-11-19 14:52:41 +08:00
[fix] fix the bug that BashUtil.CopyDir calls UnityEditor.FileUtil.CopyFileOrDirectory failed when parent directory of dst does not exist.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user