summaryrefslogtreecommitdiff
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
parent8757b02d6405bbe788281be2eeaa0c23ba27c5b0 (diff)
Fix shellcheck warnings
-rwxr-xr-xmesa-debug2
-rwxr-xr-xmesa-debug-asan2
-rwxr-xr-xmesa-debug-optimized2
-rwxr-xr-xmesa-gdb2
-rwxr-xr-xmesa-release2
-rwxr-xr-xmesa-run11
6 files changed, 13 insertions, 8 deletions
diff --git a/mesa-debug b/mesa-debug
index a49968a..bbc75c9 100755
--- a/mesa-debug
+++ b/mesa-debug
@@ -5,4 +5,4 @@ export cxxflags="${cflags}"
export buildtype=debug
export builddir=~/projects/mesa/build-debug
-exec mesa-run $@
+exec mesa-run "$@"
diff --git a/mesa-debug-asan b/mesa-debug-asan
index 151140a..366dba9 100755
--- a/mesa-debug-asan
+++ b/mesa-debug-asan
@@ -6,4 +6,4 @@ export buildtype=debug
export builddir=~/projects/mesa/build-debug-asan
export extra_args=-Db_sanitize=address,undefined
-exec mesa-run $@
+exec mesa-run "$@"
diff --git a/mesa-debug-optimized b/mesa-debug-optimized
index c0a07e6..f620f56 100755
--- a/mesa-debug-optimized
+++ b/mesa-debug-optimized
@@ -5,4 +5,4 @@ export cxxflags="${cflags}"
export buildtype=debugoptimized
export builddir=~/projects/mesa/build-debug-optimized
-exec mesa-run $@
+exec mesa-run "$@"
diff --git a/mesa-gdb b/mesa-gdb
index 4549274..e14d0c6 100755
--- a/mesa-gdb
+++ b/mesa-gdb
@@ -1,3 +1,3 @@
#!/bin/bash
-mesa-debug gdb -q --args $@
+mesa-debug gdb -q --args "$@"
diff --git a/mesa-release b/mesa-release
index 9e5f347..fa16911 100755
--- a/mesa-release
+++ b/mesa-release
@@ -5,4 +5,4 @@ export cxxflags="${cflags}"
export buildtype=release
export builddir=~/projects/mesa/build-release
-exec mesa-run $@
+exec mesa-run "$@"
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 "$@"