mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-11-27 18:11:20 +00:00
Update WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs
Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
This commit is contained in:
parent
c392b6a08a
commit
daea458f64
|
|
@ -207,25 +207,21 @@ namespace WelsonJS.Launcher
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
return workingDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void CopyDirectoryRecursive(string sourceDir, string destDir)
|
var sourceDirInfo = new DirectoryInfo(sourceDir);
|
||||||
{
|
|
||||||
if (!Directory.Exists(sourceDir))
|
|
||||||
{
|
|
||||||
throw new DirectoryNotFoundException("Source directory not found: " + sourceDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
Directory.CreateDirectory(destDir);
|
// Create all subdirectories
|
||||||
|
foreach (DirectoryInfo dir in sourceDirInfo.GetDirectories("*", SearchOption.AllDirectories))
|
||||||
foreach (var file in Directory.GetFiles(sourceDir, "*", SearchOption.AllDirectories))
|
{
|
||||||
{
|
Directory.CreateDirectory(Path.Combine(destDir, dir.FullName.Substring(sourceDirInfo.FullName.Length + 1)));
|
||||||
string relativePath = file.Substring(sourceDir.Length).TrimStart(
|
}
|
||||||
Path.DirectorySeparatorChar,
|
|
||||||
Path.AltDirectorySeparatorChar
|
|
||||||
);
|
|
||||||
|
|
||||||
|
// Copy all files
|
||||||
|
foreach (FileInfo file in sourceDirInfo.GetFiles("*", SearchOption.AllDirectories))
|
||||||
|
{
|
||||||
|
string targetPath = Path.Combine(destDir, file.FullName.Substring(sourceDirInfo.FullName.Length + 1));
|
||||||
|
file.CopyTo(targetPath, true);
|
||||||
|
}
|
||||||
string targetPath = Path.Combine(destDir, relativePath);
|
string targetPath = Path.Combine(destDir, relativePath);
|
||||||
string targetDir = Path.GetDirectoryName(targetPath);
|
string targetDir = Path.GetDirectoryName(targetPath);
|
||||||
if (!Directory.Exists(targetDir))
|
if (!Directory.Exists(targetDir))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user