Skip to content

Commit aa8fa8e

Browse files
pl4ntyCopilot
andauthored
Bubble up child process errors in IndexCreationTool
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Signed-off-by: Tom Plant <tom.plant@devicie.com>
1 parent 9ab3611 commit aa8fa8e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/WinGetSourceCreator/Helpers.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,7 @@ public static void Unpack(string package, string outDir)
8686
string pathToSDK = SDKDetector.Instance.LatestSDKBinPath;
8787
string makeappxExecutable = Path.Combine(pathToSDK, "makeappx.exe");
8888
string args = $"unpack /nv /p \"{package}\" /d \"{outDir}\"";
89-
Process p = new Process
90-
{
91-
StartInfo = new ProcessStartInfo(makeappxExecutable, args)
92-
};
93-
p.Start();
94-
p.WaitForExit();
89+
RunCommand(makeappxExecutable, args);
9590
}
9691

9792
public static void PackWithMappingFile(string outputPackage, string mappingFile)
@@ -138,6 +133,11 @@ public static void RunCommand(string command, string args, string? workingDirect
138133
}
139134
p.Start();
140135
p.WaitForExit();
136+
137+
if (p.ExitCode != 0)
138+
{
139+
throw new Exception($"Command failed with exit code {p.ExitCode}: {command} {args}");
140+
}
141141
}
142142

143143
// If in the future we edit more elements, this should be a nice wrapper class.

0 commit comments

Comments
 (0)