Skip to content

Commit

Permalink
refactor: use if for var absence check uniformly
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Feb 18, 2022
1 parent 53b97c9 commit bb6ef88
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/java_build_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ jvb::mvn_cmd() {
################################################################################

jvb::__auto_run_when_source() {
# set VAR IF absent
JVB_JAVA_OPT_DEBUG_PORT="${JVB_JAVA_OPT_DEBUG_PORT:-$JVB_JAVA_OPT_DEFAULT_DEBUG_PORT}"
# set VAR if absent

if [ -z "${JVB_JAVA_OPT_DEBUG_PORT:-}" ]; then
JVB_JAVA_OPT_DEBUG_PORT="$JVB_JAVA_OPT_DEFAULT_DEBUG_PORT"
fi

if [ -z "${JVB_JAVA_OPTS[*]:-}" ]; then
JVB_JAVA_OPTS=("${JVB_DEFAULT_JAVA_OPTS[@]}")
Expand Down

0 comments on commit bb6ef88

Please sign in to comment.