Skip to content

Commit 9a4af68

Browse files
authored
Merge pull request #2274 from seefood/ira/shellcheck_2
2 parents d7439ab + 0a92d76 commit 9a4af68

File tree

9 files changed

+198
-219
lines changed

9 files changed

+198
-219
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
bats-test:
88
strategy:
99
matrix:
10-
os: [ubuntu-20.04, ubuntu-22.04, macos-14, macos-15]
10+
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-14]
1111

1212
runs-on: ${{ matrix.os }}
1313

clean_files.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ completion/available/awscli.completion.bash
4040
completion/available/bash-it.completion.bash
4141
completion/available/brew.completion.bash
4242
completion/available/bundler.completion.bash
43+
completion/available/capistrano.completion.bash
4344
completion/available/cargo.completion.bash
4445
completion/available/composer.completion.bash
4546
completion/available/conda.completion.bash
4647
completion/available/consul.completion.bash
4748
completion/available/dart.completion.bash
49+
completion/available/dirs.completion.bash
4850
completion/available/django.completion.bash
4951
completion/available/dmidecode.completion.bash
52+
completion/available/docker-compose.completion.bash
5053
completion/available/docker-machine.completion.bash
5154
completion/available/docker.completion.bash
5255
completion/available/dotnet.completion.bash
@@ -130,18 +133,16 @@ plugins/available/pyenv.plugin.bash
130133
plugins/available/python.plugin.bash
131134
plugins/available/rbenv.plugin.bash
132135
plugins/available/ruby.plugin.bash
136+
plugins/available/sudo.plugin.bash
133137
plugins/available/textmate.plugin.bash
138+
plugins/available/thefuck.plugin.bash
134139
plugins/available/todo.plugin.bash
135140
plugins/available/url.plugin.bash
141+
plugins/available/virtualenv.plugin.bash
136142
plugins/available/xterm.plugin.bash
143+
plugins/available/z_autoenv.plugin.bash
137144
plugins/available/zoxide.plugin.bash
138145

139-
# tests
140-
#
141-
test/completion/aliases.completion.bats
142-
test/run
143-
test/test_helper.bash
144-
145146
# themes
146147
#
147148
themes/90210
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
#!/usr/bin/env bash
1+
# shellcheck shell=bash
22
# Bash completion support for Capistrano.
33

44
export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/}
55

66
_capcomplete() {
7-
if [ -f Capfile ]; then
8-
recent=`ls -t .cap_tasks~ Capfile **/*.cap 2> /dev/null | head -n 1`
9-
if [[ $recent != '.cap_tasks~' ]]; then
10-
cap --version | grep 'Capistrano v2.' > /dev/null
11-
if [ $? -eq 0 ]; then
12-
# Capistrano 2.x
13-
cap --tool --verbose --tasks | cut -d " " -f 2 > .cap_tasks~
14-
else
15-
# Capistrano 3.x
16-
cap --all --tasks | cut -d " " -f 2 > .cap_tasks~
17-
fi
18-
fi
19-
COMPREPLY=($(compgen -W "`cat .cap_tasks~`" -- ${COMP_WORDS[COMP_CWORD]}))
20-
return 0
21-
fi
7+
if [ -f Capfile ]; then
8+
# shellcheck disable=SC2012
9+
recent=$(ls -t .cap_tasks~ Capfile ./**/*.cap 2> /dev/null | head -n 1)
10+
if [[ $recent != '.cap_tasks~' ]]; then
11+
if cap --version | grep -q 'Capistrano v2.'; then
12+
# Capistrano 2.x
13+
cap --tool --verbose --tasks | cut -d " " -f 2 > .cap_tasks~
14+
else
15+
# Capistrano 3.x
16+
cap --all --tasks | cut -d " " -f 2 > .cap_tasks~
17+
fi
18+
fi
19+
# shellcheck disable=SC2207
20+
COMPREPLY=($(compgen -W "$(cat .cap_tasks~)" -- "${COMP_WORDS[COMP_CWORD]}"))
21+
return 0
22+
fi
2223
}
2324

2425
complete -o default -o nospace -F _capcomplete cap
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
#!/usr/bin/env bash
1+
# shellcheck shell=bash
22
# Bash completion support for the 'dirs' plugin (commands G, R).
33

44
_dirs-complete() {
5-
local CURRENT_PROMPT="${COMP_WORDS[COMP_CWORD]}"
5+
local CURRENT_PROMPT="${COMP_WORDS[COMP_CWORD]}"
66

7-
# parse all defined shortcuts from ~/.dirs
8-
if [ -r "$HOME/.dirs" ]; then
9-
COMPREPLY=($(compgen -W "$(grep -v '^#' ~/.dirs | sed -e 's/\(.*\)=.*/\1/')" -- ${CURRENT_PROMPT}) )
10-
fi
7+
# parse all defined shortcuts from ~/.dirs
8+
if [ -r "$HOME/.dirs" ]; then
9+
# shellcheck disable=SC2207
10+
COMPREPLY=($(compgen -W "$(grep -v '^#' ~/.dirs | sed -e 's/\(.*\)=.*/\1/')" -- "${CURRENT_PROMPT}"))
11+
fi
1112

12-
return 0
13+
return 0
1314
}
1415

1516
complete -o default -o nospace -F _dirs-complete G R

0 commit comments

Comments
 (0)