Fix completions workflow

This commit is contained in:
Tobias Reisinger 2024-01-12 02:40:58 +01:00
parent 6c2eeb4c9b
commit 5cc3d5144d
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
2 changed files with 10 additions and 2 deletions

View file

@ -1,9 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
pipe=${args[--pipe]:?} pipe=${args[--pipe]:?}
completions=${args[--completions]:-}
target=${args[target]:?} target=${args[target]:?}
url=${args[url]:?} url=${args[url]:?}
completions=${args[completions]:-}
if [ "${action:-file}" = "exe" ] if [ "${action:-file}" = "exe" ]
then then
@ -30,7 +30,7 @@ then
then then
chmod +x "$target" chmod +x "$target"
if [ -z "$completions" ] if [ -n "$completions" ]
then then
echo "Installing completions for $exe" echo "Installing completions for $exe"
# shellcheck disable=SC2086 # shellcheck disable=SC2086

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
group=${args[group]:?} group=${args[group]:?}
clean=${args[--clean]:-}
_config_query() { _config_query() {
tomlq -c --arg group "$group" \ tomlq -c --arg group "$group" \
@ -17,16 +18,23 @@ _config_query ".[]" | while read -r entry; do
target=$(echo "$entry" | jq -r '.target') target=$(echo "$entry" | jq -r '.target')
hook=$(echo "$entry" | jq -r '.hook // ""') hook=$(echo "$entry" | jq -r '.hook // ""')
pipe=$(echo "$entry" | jq -r '.pipe // ""') pipe=$(echo "$entry" | jq -r '.pipe // ""')
completions=$(echo "$entry" | jq -r '.completions // ""')
if [[ -n "$hook" ]]; then if [[ -n "$hook" ]]; then
install_args+=("--hook=$hook") install_args+=("--hook=$hook")
fi fi
if [[ -n "$clean" ]]; then
install_args+=("--clean")
fi
install_args+=("$type") install_args+=("$type")
if [[ -n "$pipe" ]]; then if [[ -n "$pipe" ]]; then
install_args+=("--pipe=$pipe") install_args+=("--pipe=$pipe")
fi fi
if [[ -n "$completions" ]]; then
install_args+=("--completions=$completions")
fi
if [[ $source = \$* ]] if [[ $source = \$* ]]
then then