Skip to content

Commit

Permalink
extract_version_values: better check specified path argument
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPawn committed Mar 24, 2021
1 parent 049839b commit 27036fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions toolbox/image/extract_version_values
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ src="${src%/}"
# at least one slash is needed, if called for root filesystem
[ -z "$src" ] && src="/"

if ! [ -d "$src" ]; then
printf "'%s' is not a valid directory name / directory was not found.\a\n" "$src" 1>&2
exit 1
fi

for cmd in sed grep find date readlink expr; do
if ! command -v $cmd >/dev/null 2>&1; then
printf "Missing '%s' command, needed for this script.\a\n" "$cmd" 1>&2
Expand Down

0 comments on commit 27036fe

Please sign in to comment.