dependency-check / dependency-check/DependencyCheck

Support for bash strict mode

Open
#3,287 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
7.7k
Forks
1.4k
Avg merge
9d 22h
Merged PRs (30d)
13

Description

When running `dependency-check.sh` from a bash script which uses the highly popular "strict mode" though [set](https://www.gnu.org/software/bash/manual/bash.html#index-set), eg `set -euo pipefail`, an error is thrown because `dependency-check.sh` checks for a value in the (usually unset) variable `JAVACMD` with the message `dependency-check/bin/dependency-check.sh: line 75: JAVACMD: unbound variable`.
This could be remedied by substitution, eg replacing `[ -z "$JAVACMD" ]` with `[ -z "${JAVACMD:-}" ]` (similarly for other potentially unbound variables), which circumvents the unbound variable errors that bash throws when `set -u` is used

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.