Skip to content

Commit f520787

Browse files
authored
Merge pull request #142 from ionite34/fix-7z-space-paths
2 parents ec06397 + a1ba088 commit f520787

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

StabilityMatrix/Helper/ArchiveHelper.cs

+6-8
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@ public static async Task AddToArchive7Z(string archivePath, string sourceDirecto
5454

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

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

9391
await process.WaitForExitAsync();
9492

0 commit comments

Comments
 (0)