From f546041bc4fbc722bc1460f0cbb628597a2cbe68 Mon Sep 17 00:00:00 2001 From: Cibbi <12004047+Cibbi@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:52:22 +0100 Subject: [PATCH] Return 1 if any exception happens --- VRLabs.VRCTools.Packaging.Console/Program.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/VRLabs.VRCTools.Packaging.Console/Program.cs b/VRLabs.VRCTools.Packaging.Console/Program.cs index 66a913d..1c711f9 100644 --- a/VRLabs.VRCTools.Packaging.Console/Program.cs +++ b/VRLabs.VRCTools.Packaging.Console/Program.cs @@ -29,11 +29,19 @@ command.SetHandler(async (source, output, releaseUrl, unityReleaseUrl, version, noVcc, noUnity, action) => { - Environment.SetEnvironmentVariable("RUNNING_ON_GITHUB_ACTIONS", action ? "true" : "false"); - var result = await Packager.CreatePackage(source, output, releaseUrl, unityReleaseUrl, version, noVcc, noUnity); - if (!result) + try { - Log.Error("Failed to create package"); + Environment.SetEnvironmentVariable("RUNNING_ON_GITHUB_ACTIONS", action ? "true" : "false"); + var result = await Packager.CreatePackage(source, output, releaseUrl, unityReleaseUrl, version, noVcc, noUnity); + if (!result) + { + Log.Error("Failed to create package"); + Environment.Exit(1); + } + } + catch (Exception e) + { + Log.Error(e, "Failed to create package"); Environment.Exit(1); }