Fix copying bug
This commit is contained in:
@@ -9,5 +9,4 @@ SetVolumeLabelW
|
||||
GUID
|
||||
DISK_GEOMETRY
|
||||
PARTITION_INFORMATION
|
||||
PARTITION_INFORMATION_EX
|
||||
SET_PARTITION_INFORMATION
|
||||
PARTITION_INFORMATION_EX
|
||||
@@ -47,11 +47,11 @@ namespace BadBuilder
|
||||
|
||||
itemsToDownload.Sort((a, b) => b.name.Length.CompareTo(a.name.Length));
|
||||
|
||||
if (!Directory.Exists($"{DOWNLOAD_DIR}"))
|
||||
Directory.CreateDirectory($"{DOWNLOAD_DIR}");
|
||||
|
||||
if (itemsToDownload.Any())
|
||||
{
|
||||
if (!Directory.Exists($"{DOWNLOAD_DIR}"))
|
||||
Directory.CreateDirectory($"{DOWNLOAD_DIR}");
|
||||
|
||||
HttpClient downloadClient = new();
|
||||
|
||||
await AnsiConsole.Progress()
|
||||
@@ -90,7 +90,7 @@ namespace BadBuilder
|
||||
if (File.Exists(destinationPath)) continue;
|
||||
|
||||
string existingPath = AnsiConsole.Prompt(
|
||||
new TextPrompt<string>($"Enter the path for the [bold]{selectedItem}[/] archive:")
|
||||
new TextPrompt<string>($"Enter the path to the [bold]{selectedItem}[/] archive:")
|
||||
.PromptStyle(LightOrangeStyle)
|
||||
.Validate(path =>
|
||||
{
|
||||
@@ -100,11 +100,19 @@ namespace BadBuilder
|
||||
})
|
||||
).Trim().Trim('"');
|
||||
|
||||
File.Copy(existingPath, destinationPath, overwrite: true);
|
||||
AnsiConsole.MarkupLine($"[italic #76B900]Successfully copied [bold]{selectedItem}[/] to the working directory.[/]\n");
|
||||
Console.WriteLine(existingPath);
|
||||
try
|
||||
{
|
||||
File.Copy(existingPath, destinationPath, overwrite: true);
|
||||
AnsiConsole.MarkupLine($"[italic #76B900]Successfully copied [bold]{selectedItem}[/] to the working directory.[/]\n");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
AnsiConsole.MarkupLine($"[italic red]Failed to copy [bold]{selectedItem}[/] to the working directory. Exception: {ex.Message}[/]\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return items.Select(item => new ArchiveItem(item.name, Path.Combine(DOWNLOAD_DIR, item.url.Split('/').Last()))).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace BadBuilder
|
||||
[#CCE388]██████╔╝██║ ██║██████╔╝██████╔╝╚██████╔╝██║███████╗██████╔╝███████╗██║ ██║[/]
|
||||
[#CCE388]╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝ ╚══════╝╚═╝ ╚═╝[/]
|
||||
|
||||
[#76B900]──────────────────────────────────────────────────────────────────────v0.10a[/]
|
||||
[#76B900]──────────────────────────────────────────────────────────────────────v0.20a[/]
|
||||
───────────────────────Xbox 360 [#FF7200]BadUpdate[/] USB Builder───────────────────────
|
||||
[#848589]Created by Pdawg[/]
|
||||
[#76B900]────────────────────────────────────────────────────────────────────────────[/]
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
internal static class Constants
|
||||
{
|
||||
internal const string WORKING_DIR = "Work";
|
||||
internal const string DOWNLOAD_DIR = $@"{WORKING_DIR}\\Download";
|
||||
internal const string EXTRACTED_DIR = $@"{WORKING_DIR}\\Extract";
|
||||
internal const string DOWNLOAD_DIR = $@"{WORKING_DIR}\Download";
|
||||
internal const string EXTRACTED_DIR = $@"{WORKING_DIR}\Extract";
|
||||
|
||||
internal const string ContentFolder = "Content\\0000000000000000\\";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user