generated from RuiFPB/tyra-linux-template
Update .gitignore, fix docker-compose volume, and improve pcsx2 error handling
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
# ---
|
# ---
|
||||||
|
.env
|
||||||
|
|
||||||
# Prerequisites
|
# Prerequisites
|
||||||
*.d
|
*.d
|
||||||
|
|||||||
+1
-1
@@ -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
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user