From d8cc3c097f96c481c5299a3b589af25d560612dc Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Tue, 3 Sep 2024 18:40:12 -0700 Subject: [PATCH] client: docker: lib_plugins: allow path depth - Allows plugins to function within subdirectories - Removes redundant arg checking --- client/src/docker/lib/internal/lib_plugins.bash | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/client/src/docker/lib/internal/lib_plugins.bash b/client/src/docker/lib/internal/lib_plugins.bash index a4ff8d2..f6ad51b 100644 --- a/client/src/docker/lib/internal/lib_plugins.bash +++ b/client/src/docker/lib/internal/lib_plugins.bash @@ -88,13 +88,11 @@ function lib_plugins::__parse_args() [[ ! "$_arg" =~ (^repo${global_arg_delim_1}|^custom${global_arg_delim_1}) ]] && lib_utils::die_usage "$_usage" - local -r _key="${_arg%${global_arg_delim_1}*}" + local -r _key="${_arg%%${global_arg_delim_1}*}" local -r _len="$((${#_key} + 1))" - if [[ "$_key" =~ ^repo$|^custom$ ]]; then - local -r _arg_type="${_arg:${_len}}" - [ -z "$_arg_type" ] && lib_utils::die_usage "$_usage" - fi + local -r _arg_type="${_arg:${_len}}" + [ -z "$_arg_type" ] && lib_utils::die_usage "$_usage" local _path case "$_key" in