From 23d9f92769459537dbb1c3b24522efc9daddb485 Mon Sep 17 00:00:00 2001 From: domenix Date: Sat, 25 Jul 2026 10:15:43 +0200 Subject: [PATCH 1/2] Make scc exit with a non-zero code when compilation fails The CLI previously discarded the compilation result and always exited with code 0, making it impossible for callers (such as the macOS launch script) to detect failures. Check the result via scc_get_success and exit with code 1 on fatal errors. --- crates/scc/cli/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/scc/cli/src/main.rs b/crates/scc/cli/src/main.rs index 0f85b6c8..94658b0b 100644 --- a/crates/scc/cli/src/main.rs +++ b/crates/scc/cli/src/main.rs @@ -47,6 +47,7 @@ fn run(r6_dir: &Path, args: Option) -> anyhow::Result<()> { .context("missing 'settings_add_script_path'")?; let compile = api.compile.context("missing 'compile'")?; let free_result = api.free_result.context("missing 'free_result'")?; + let get_success = api.get_success.context("missing 'get_success'")?; let root = c_path(r6_dir)?; @@ -72,7 +73,12 @@ fn run(r6_dir: &Path, args: Option) -> anyhow::Result<()> { } let res = compile(settings); + let succeeded = !get_success(res).is_null(); free_result(res); + + if !succeeded { + std::process::exit(1); + } } Ok(()) From cf23341df3d80aca55ebb4faed85fe6920979338 Mon Sep 17 00:00:00 2001 From: domenix Date: Sat, 25 Jul 2026 10:15:43 +0200 Subject: [PATCH 2/2] Abort modded launch on macOS when script compilation fails launch_modded.sh previously launched the game even if scc failed, silently running with the last successfully compiled scripts. Now it stops, prints the error, and shows an alert dialog instead. Also launch the app bundle via 'open' so the game starts as a regular app instead of a child of the shell. --- assets/macos/archive/launch_modded.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/assets/macos/archive/launch_modded.sh b/assets/macos/archive/launch_modded.sh index a470f8e7..5441a51e 100755 --- a/assets/macos/archive/launch_modded.sh +++ b/assets/macos/archive/launch_modded.sh @@ -1,7 +1,14 @@ #!/usr/bin/env bash # Compiles REDscript and launches the game. +set -euo pipefail game_dir=$(dirname "$(readlink -f "$0")") -"$game_dir/engine/tools/scc" -compile "$game_dir/r6/scripts" -"$game_dir/Cyberpunk2077.app/Contents/MacOS/Cyberpunk2077" +if ! "$game_dir/engine/tools/scc" -compile "$game_dir/r6/scripts"; then + message="REDscript compilation failed, the game was not launched. Check r6/logs/redscript_rCURRENT.log for details." + echo "$message" >&2 + osascript -e "display alert \"REDscript\" message \"$message\" as critical" >/dev/null 2>&1 || true + exit 1 +fi + +open "$game_dir/Cyberpunk2077.app"