Skip to content

Commit 0196835

Browse files
authored
improve ci_scripts/base_util.sh debug functionality (#1649)
1 parent 12d08d6 commit 0196835

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ci_scripts/base_util.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,17 @@ debug() {
8686
local var_name="$1"
8787
local var_value="${!var_name}" # Indirect reference to get the value
8888
if [[ -f "$var_value" ]]; then
89+
# Prints out the supplied file path and the content of the file
8990
echo "[DEBUG] $var_name: Content of file $var_value:"
9091
cat "$var_value"
9192
else
92-
echo "[DEBUG] $var_name: $var_value"
93+
if [[ -z "$var_value" ]]; then
94+
# Prints out the supplied string's value
95+
echo "[DEBUG] $var_name"
96+
else
97+
# Prints out the supplied variable name and value
98+
echo "[DEBUG] $var_name: $var_value"
99+
fi
93100
fi
94101
fi
95102
}

0 commit comments

Comments
 (0)