diff --git a/autoinstall/file_command.sh b/autoinstall/file_command.sh index 3f4abf3..09ff198 100644 --- a/autoinstall/file_command.sh +++ b/autoinstall/file_command.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash pipe=${args[--pipe]:?} +completions=${args[--completions]:-} target=${args[target]:?} url=${args[url]:?} -completions=${args[completions]:-} if [ "${action:-file}" = "exe" ] then @@ -30,7 +30,7 @@ then then chmod +x "$target" - if [ -z "$completions" ] + if [ -n "$completions" ] then echo "Installing completions for $exe" # shellcheck disable=SC2086 diff --git a/autoinstall/run_command.sh b/autoinstall/run_command.sh index c585ce2..7703daf 100644 --- a/autoinstall/run_command.sh +++ b/autoinstall/run_command.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash group=${args[group]:?} +clean=${args[--clean]:-} _config_query() { tomlq -c --arg group "$group" \ @@ -17,16 +18,23 @@ _config_query ".[]" | while read -r entry; do target=$(echo "$entry" | jq -r '.target') hook=$(echo "$entry" | jq -r '.hook // ""') pipe=$(echo "$entry" | jq -r '.pipe // ""') + completions=$(echo "$entry" | jq -r '.completions // ""') if [[ -n "$hook" ]]; then install_args+=("--hook=$hook") fi + if [[ -n "$clean" ]]; then + install_args+=("--clean") + fi install_args+=("$type") if [[ -n "$pipe" ]]; then install_args+=("--pipe=$pipe") fi + if [[ -n "$completions" ]]; then + install_args+=("--completions=$completions") + fi if [[ $source = \$* ]] then