Skip to content

Commit 82263c1

Browse files
committed
fix windows locking of dlls
1 parent 9081e36 commit 82263c1

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

Runtime/LLMBuilder.cs

+15-5
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ private static void InitializeOnLoad()
1717
{
1818
Reset();
1919
}
20-
21-
public static void CopyPath(string source, string target)
20+
21+
public static void HandleActionFileRecursive(string source, string target, ActionCallback actionCallback)
2222
{
2323
if (File.Exists(source))
2424
{
25-
File.Copy(source, target, true);
25+
actionCallback(source, target);
2626
}
2727
else if (Directory.Exists(source))
2828
{
@@ -32,14 +32,24 @@ public static void CopyPath(string source, string target)
3232
filesAndDirs.AddRange(Directory.GetDirectories(source));
3333
foreach (string path in filesAndDirs)
3434
{
35-
CopyPath(path, Path.Combine(target, Path.GetFileName(path)));
35+
HandleActionFileRecursive(path, Path.Combine(target, Path.GetFileName(path)), actionCallback);
3636
}
3737
}
3838
}
3939

40+
public static void CopyWithOverwrite(string source, string target)
41+
{
42+
File.Copy(source, target, true);
43+
}
44+
45+
public static void CopyPath(string source, string target)
46+
{
47+
HandleActionFileRecursive(source, target, CopyWithOverwrite);
48+
}
49+
4050
public static void MovePath(string source, string target)
4151
{
42-
CopyPath(source, target);
52+
HandleActionFileRecursive(source, target, File.Move);
4353
DeletePath(source);
4454
}
4555

0 commit comments

Comments
 (0)