From 3fc4f50fd7d2d1c349907e34e7337c4449bbf384 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 18 May 2023 13:37:36 -0400 Subject: Fix shellcheck warnings --- mesa-debug | 2 +- mesa-debug-asan | 2 +- mesa-debug-optimized | 2 +- mesa-gdb | 2 +- mesa-release | 2 +- mesa-run | 11 ++++++++--- 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 "$@" -- cgit v1.2.3