Skip to content

Commit

Permalink
fix(sbopkg): work around nounset
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Aug 12, 2023
1 parent 62df9e5 commit 9709bdf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions completions/sbopkg
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ _comp_cmd_sbopkg()

local i config
config="/etc/sbopkg/sbopkg.conf"
for ((i = ${#words[@]} - 1; i > 0; i--)); do
for ((i = ${#words[@]} - 2; i > 0; i--)); do
if [[ ${words[i]} == -f ]]; then
config="${words[i + 1]}"
__expand_tilde_by_ref config
Expand All @@ -47,7 +47,7 @@ _comp_cmd_sbopkg()
[[ -r $config ]] || return
. "$config"

for ((i = 1; i < ${#words[@]}; i++)); do
for ((i = 1; i < ${#words[@]} - 1; i++)); do
case "${words[i]}" in
-V)
REPO_NAME="${words[i + 1]%%/*}"
Expand All @@ -58,11 +58,12 @@ _comp_cmd_sbopkg()
;;
esac
done
[[ -r $REPO_ROOT/$REPO_NAME/$REPO_BRANCH/SLACKBUILDS.TXT ]] || return
local file=${REPO_ROOT-}/${REPO_NAME-}/${REPO_BRANCH-}/SLACKBUILDS.TXT
[[ -r $file ]] || return

COMPREPLY=($(
command sed -ne "/^SLACKBUILD NAME: $cur/{s/^SLACKBUILD NAME: //;p}" \
"$REPO_ROOT/$REPO_NAME/$REPO_BRANCH/SLACKBUILDS.TXT"
"$file"
))
_comp_compgen -aC "$QUEUEDIR" -- -f -X "!*.sqf"
} &&
Expand Down

0 comments on commit 9709bdf

Please sign in to comment.