From 02e65014b2d0191e03aa98e5494ce57e83816e0f Mon Sep 17 00:00:00 2001 From: xuty Date: Fri, 3 Jan 2025 23:28:06 +0800 Subject: [PATCH] Improve error handling in Builder --- Plugins/BuilderPlugin/Steps/MacOSBundleStep.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Plugins/BuilderPlugin/Steps/MacOSBundleStep.swift b/Plugins/BuilderPlugin/Steps/MacOSBundleStep.swift index 8e4c52f..c28aa12 100644 --- a/Plugins/BuilderPlugin/Steps/MacOSBundleStep.swift +++ b/Plugins/BuilderPlugin/Steps/MacOSBundleStep.swift @@ -23,18 +23,18 @@ func executeMacOSBundleStep(_ input: MacOSBundleInput, context: StepContext) { if !buildResult.succeeded { print("Build failed. See logs above for details.") - return + exit(1) } guard let mainArtifect = buildResult.builtArtifacts.first else { - print("No built artifacts found. Skipping bundle creation.") - return + print("No built artifacts found. Cannot create bundle.") + exit(1) } print("Main artifact: \(mainArtifect.path.string)") if mainArtifect.kind != .executable { - print("Main artifact is \(mainArtifect.kind). Skipping bundle creation.") - return + print("Main artifact is \(mainArtifect.kind). Cannot create bundle.") + exit(1) } print("Creating bundle with input: \(input)")