[fix] fix the bug that BashUtil.CopyDir calls UnityEditor.FileUtil.CopyFileOrDirectory failed when parent directory of dst does not exist.
parent
d505624c78
commit
814572e1a1
|
|
@ -108,7 +108,15 @@ namespace HybridCLR.Editor.Installer
|
||||||
{
|
{
|
||||||
UnityEngine.Debug.Log($"[BashUtil] CopyDir {src} => {dst}");
|
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);
|
UnityEditor.FileUtil.CopyFileOrDirectory(src, dst);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue