diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml deleted file mode 100644 index daee628f88..0000000000 --- a/.github/workflows/copilot-setup-steps.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: "Copilot Setup Steps" - -# Automatically run the setup steps when they are changed to allow for easy validation, and -# allow manual testing through the repository's "Actions" tab -on: - workflow_dispatch: - push: - paths: - - .github/workflows/copilot-setup-steps.yml - pull_request: - paths: - - .github/workflows/copilot-setup-steps.yml - -jobs: - # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. - copilot-setup-steps: - runs-on: windows-latest - - # Set the permissions to the lowest permissions possible needed for your steps. - # Copilot will be given its own token for its operations. - permissions: - # If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. - # If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete. - contents: read diff --git a/src/WinGetSourceCreator/Helpers.cs b/src/WinGetSourceCreator/Helpers.cs index 7e34735064..438860a4aa 100644 --- a/src/WinGetSourceCreator/Helpers.cs +++ b/src/WinGetSourceCreator/Helpers.cs @@ -86,12 +86,7 @@ public static void Unpack(string package, string outDir) string pathToSDK = SDKDetector.Instance.LatestSDKBinPath; string makeappxExecutable = Path.Combine(pathToSDK, "makeappx.exe"); string args = $"unpack /nv /p \"{package}\" /d \"{outDir}\""; - Process p = new Process - { - StartInfo = new ProcessStartInfo(makeappxExecutable, args) - }; - p.Start(); - p.WaitForExit(); + RunCommand(makeappxExecutable, args); } public static void PackWithMappingFile(string outputPackage, string mappingFile) @@ -138,6 +133,11 @@ public static void RunCommand(string command, string args, string? workingDirect } p.Start(); p.WaitForExit(); + + if (p.ExitCode != 0) + { + throw new Exception($"Command failed with exit code {p.ExitCode}: {command} {args}"); + } } // If in the future we edit more elements, this should be a nice wrapper class.