Don't allow unset variables in the list commands

This commit is contained in:
Trevor Brown 2020-10-14 17:16:37 -04:00
parent 03f2fb7e4c
commit e72f421be2
2 changed files with 10 additions and 4 deletions

View File

@ -1,4 +1,7 @@
# -*- sh -*-
set -o nounset
# shellcheck source=lib/functions/versions.bash
. "$(dirname "$(dirname "$0")")/lib/functions/versions.bash"

View File

@ -1,8 +1,10 @@
# -*- sh -*-
set -o nounset
list_command() {
local plugin_name=$1
local query=$2
local plugin_name=${1:-}
local query=${2:-}
if [ -z "$plugin_name" ]; then
local plugins_path
@ -24,9 +26,10 @@ list_command() {
}
display_installed_versions() {
local plugin_name=$1
local query=$2
local plugin_name=${1:-}
local query=${2:-}
local versions
versions=$(list_installed_versions "$plugin_name")
if [[ $query ]]; then