Update .gitignore, fix docker-compose volume, and improve pcsx2 error handling

This commit is contained in:
2026-06-16 10:24:23 +01:00
parent 9de9e78011
commit 2a8d524938
3 changed files with 12 additions and 7 deletions
+1
View File
@@ -1,4 +1,5 @@
# --- # ---
.env
# Prerequisites # Prerequisites
*.d *.d
+1 -1
View File
@@ -13,4 +13,4 @@ services:
container_name: tyra-game-compiler container_name: tyra-game-compiler
volumes: volumes:
- tyra-game-volume:/src - tyra-game-volume:/src
- ./:/host - ./:/host:Z
+10 -6
View File
@@ -33,12 +33,17 @@ find_pcsx2() {
fi fi
echo "Error: PCSX2 not found! Please install it, put it in PATH, or specify CUSTOM_PCSX2_PATH in this script." >&2 echo "Error: PCSX2 not found! Please install it, put it in PATH, or specify CUSTOM_PCSX2_PATH in this script." >&2
exit 1 return 1
} }
run_pcsx2() { run_pcsx2() {
local pcsx2_cmd local pcsx2_cmd
pcsx2_cmd=$(find_pcsx2) if ! pcsx2_cmd=$(find_pcsx2); then
# Handle the error here, at the top level
exit 1
fi
local -a pcsx2_args
read -ra pcsx2_args <<< "$pcsx2_cmd"
local elf_name local elf_name
elf_name=$(get_target_elf_name) elf_name=$(get_target_elf_name)
@@ -49,7 +54,6 @@ run_pcsx2() {
local target_file local target_file
target_file="$(pwd)/bin/$elf_name" target_file="$(pwd)/bin/$elf_name"
if [ ! -f "$target_file" ]; then if [ ! -f "$target_file" ]; then
echo "Error: ELF file not found at $target_file. Did you build the project?" >&2 echo "Error: ELF file not found at $target_file. Did you build the project?" >&2
exit 1 exit 1
@@ -66,9 +70,9 @@ run_pcsx2() {
fi fi
echo "Running PCSX2: $pcsx2_cmd -elf $target_file" echo "Running PCSX2: $pcsx2_cmd -elf $target_file"
# Run PCSX2 in the background nohup "${pcsx2_args[@]}" -elf "$target_file" > /dev/null 2>&1 &
$pcsx2_cmd -elf "$target_file" & disown
} }
run_pcsx2 run_pcsx2