Skip to content

Commit

Permalink
Merge pull request #142 from ionite34/fix-7z-space-paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ionite34 authored Jul 3, 2023
2 parents ec06397 + a1ba088 commit f520787
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions StabilityMatrix/Helper/ArchiveHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ public static async Task AddToArchive7Z(string archivePath, string sourceDirecto

public static async Task<ArchiveInfo> Extract7Z(string archivePath, string extractDirectory)
{
var process = ProcessRunner.StartProcess(SevenZipPath, new[]
{
"x", archivePath, $"-o{ProcessRunner.Quote(extractDirectory)}", "-y"
});
var args =
$"x {ProcessRunner.Quote(archivePath)} -o{ProcessRunner.Quote(extractDirectory)} -y";
var process = ProcessRunner.StartProcess(SevenZipPath, args);
await ProcessRunner.WaitForExitConditionAsync(process);
var output = await process.StandardOutput.ReadToEndAsync();
var matches = Regex7ZOutput.Matches(output);
Expand Down Expand Up @@ -85,10 +84,9 @@ public static async Task<ArchiveInfo> Extract7Z(string archivePath, string extra
progress.Report(new ProgressReport(-1, isIndeterminate: true, type: ProgressType.Extract));

// Need -bsp1 for progress reports
var process = ProcessRunner.StartProcess(SevenZipPath, new[]
{
"x", archivePath, $"-o{ProcessRunner.Quote(extractDirectory)}", "-y", "-bsp1"
}, outputDataReceived: onOutput);
var args =
$"x {ProcessRunner.Quote(archivePath)} -o{ProcessRunner.Quote(extractDirectory)} -y -bsp1";
var process = ProcessRunner.StartProcess(SevenZipPath, args, outputDataReceived: onOutput);

await process.WaitForExitAsync();

Expand Down

0 comments on commit f520787

Please sign in to comment.