run-in-py-utils-bt2-env.sh: remove unneeded quotes
[babeltrace.git] / tests / utils / run-in-py-env.sh
index 86d5eeb28d5b00d1a75a01ff67b7129abb1dced7..84788c56943e4b70622195e1021168b143018288 100755 (executable)
@@ -5,10 +5,10 @@
 # Copyright (C) 2017-2023 Philippe Proulx <pproulx@efficios.com>
 # Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
 
-if [[ -n "${BT_TESTS_SRCDIR:-}" ]]; then
-       UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
+if [[ -n ${BT_TESTS_SRCDIR:-} ]]; then
+       UTILSSH=$BT_TESTS_SRCDIR/utils/utils.sh
 else
-       UTILSSH="$(dirname "$0")/../utils/utils.sh"
+       UTILSSH=$(dirname "$0")/../utils/utils.sh
 fi
 
 # shellcheck source=../utils/utils.sh
@@ -25,18 +25,21 @@ usage() {
        echo "environment variable to the built \`tests\` directory."
 }
 
-if [[ -z "$*" ]]; then
+if (($# == 0)); then
        usage
        exit 1
 fi
 
 # Sanity check that the BT_TESTS_BUILDDIR value makes sense.
-if [[ ! -f "$BT_TESTS_BUILDDIR/Makefile" ]]; then
-       fold -w 80 -s <<- END
-       $0: BT_TESTS_BUILDDIR does not point to a valid directory (\`$BT_TESTS_BUILDDIR/Makefile\` does not exist).
+if [[ ! -f $BT_TESTS_BUILDDIR/Makefile ]]; then
+       {
+               echo "ERROR: Invalid \`BT_TESTS_BUILDDIR\` variable (\`\$BT_TESTS_BUILDDIR/Makefile\`"
+               echo "doesn't exist)."
+               echo ""
+               echo "If you build out of tree, export and set the \`BT_TESTS_BUILDDIR\` environment"
+               echo "variable to the built \`tests\` directory."
+       } >&2
 
-       If building out-of-tree, set BT_TESTS_BUILDDIR to point to the \`tests\` directory in the build tree.
-       END
        exit 1
 fi
 
This page took 0.026782 seconds and 4 git commands to generate.