generated from RuiFPB/tyra-linux-template
Update .gitignore, fix docker-compose volume, and improve pcsx2 error handling
This commit is contained in:
+10
-6
@@ -33,12 +33,17 @@ find_pcsx2() {
|
||||
fi
|
||||
|
||||
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() {
|
||||
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
|
||||
elf_name=$(get_target_elf_name)
|
||||
@@ -49,7 +54,6 @@ run_pcsx2() {
|
||||
|
||||
local target_file
|
||||
target_file="$(pwd)/bin/$elf_name"
|
||||
|
||||
if [ ! -f "$target_file" ]; then
|
||||
echo "Error: ELF file not found at $target_file. Did you build the project?" >&2
|
||||
exit 1
|
||||
@@ -66,9 +70,9 @@ run_pcsx2() {
|
||||
fi
|
||||
|
||||
echo "Running PCSX2: $pcsx2_cmd -elf $target_file"
|
||||
|
||||
# Run PCSX2 in the background
|
||||
$pcsx2_cmd -elf "$target_file" &
|
||||
|
||||
nohup "${pcsx2_args[@]}" -elf "$target_file" > /dev/null 2>&1 &
|
||||
disown
|
||||
}
|
||||
|
||||
run_pcsx2
|
||||
|
||||
Reference in New Issue
Block a user