projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: remove some unnecessary uses of `GString`
[babeltrace.git]
/
tests
/
utils
/
env.sh.in
diff --git
a/tests/utils/env.sh.in
b/tests/utils/env.sh.in
index 12069fef8cfafdbecf01304d7b80e885c68803d6..77e0c443ec9f00b8e96f3d27e48eba5091efc226 100644
(file)
--- a/
tests/utils/env.sh.in
+++ b/
tests/utils/env.sh.in
@@
-1,14
+1,15
@@
-#!/bin/bash
-#
# SPDX-FileCopyrightText: 2021-2022 EfficiOS, Inc.
# SPDX-License-Identifier: GPL-2.0-only
# SPDX-FileCopyrightText: 2021-2022 EfficiOS, Inc.
# SPDX-License-Identifier: GPL-2.0-only
-# Sets the variable named `$1` to `$2` if it's not set, and exports it.
+# shellcheck shell=bash
+
+# Sets the variable named `$1` to `$2` if it's not set (or empty), and
+# exports it.
_set_var_def() {
local -r varname=$1
local -r val=$2
_set_var_def() {
local -r varname=$1
local -r val=$2
- if [[ -z $
{!varname:-}
]]; then
+ if [[ -z $
(eval echo "\${$varname:-}")
]]; then
eval "$varname='$val'"
fi
eval "$varname='$val'"
fi
This page took
0.023005 seconds
and
4
git commands to generate.