summaryrefslogtreecommitdiff
path: root/mesa-run
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2023-05-18 13:37:36 -0400
committerMatt Turner <mattst88@gmail.com>2023-05-18 13:41:21 -0400
commit3fc4f50fd7d2d1c349907e34e7337c4449bbf384 (patch)
tree9cc6d4f0a18bc5e69b97f589b2ed84ceb89e09d9 /mesa-run
parent8757b02d6405bbe788281be2eeaa0c23ba27c5b0 (diff)
Fix shellcheck warnings
Diffstat (limited to 'mesa-run')
-rwxr-xr-xmesa-run11
1 files changed, 8 insertions, 3 deletions
diff --git a/mesa-run b/mesa-run
index 1196d4e..e65489b 100755
--- a/mesa-run
+++ b/mesa-run
@@ -1,5 +1,11 @@
#!/bin/bash
+die() {
+ echo "$1"
+ exit 255
+}
+
+[[ -z ${builddir} ]] && die "builddir must be set"
prefix="${builddir}"/install
machine=$(uname -m)
@@ -52,12 +58,11 @@ build)
esac
if ! command -v jq &> /dev/null; then
- echo "jq needs to be installed"
- exit -1
+ die "jq needs to be installed"
fi
libdir=$(jq -r '.[] | select(.name == "libdir").value' "${builddir}"/meson-info/intro-buildoptions.json)
export LD_LIBRARY_PATH="${prefix}/${libdir}:${LD_LIBRARY_PATH}"
export LIBGL_DRIVERS_PATH="${prefix}/${libdir}"/dri
export VK_ICD_FILENAMES="${prefix}"/share/vulkan/icd.d/"${vk_icd}"
-exec $@
+exec "$@"