Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from Bash-it:master #11

Merged
merged 20 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
bats-test:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-14, macos-15]
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-14]

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

Expand Down Expand Up @@ -62,3 +62,21 @@ jobs:
run: python3 -m pip install -r test/lint-requirements.txt
- name: Run lint
run: ./lint_clean_files.sh

lint-differential:
runs-on: ubuntu-latest

permissions:
security-events: write

steps:
- name: Repository checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- id: ShellCheck
name: Differential ShellCheck
uses: redhat-plumbers-in-action/differential-shellcheck@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 8 additions & 6 deletions clean_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,16 @@ completion/available/awscli.completion.bash
completion/available/bash-it.completion.bash
completion/available/brew.completion.bash
completion/available/bundler.completion.bash
completion/available/capistrano.completion.bash
completion/available/cargo.completion.bash
completion/available/composer.completion.bash
completion/available/conda.completion.bash
completion/available/consul.completion.bash
completion/available/dart.completion.bash
completion/available/dirs.completion.bash
completion/available/django.completion.bash
completion/available/dmidecode.completion.bash
completion/available/docker-compose.completion.bash
completion/available/docker-machine.completion.bash
completion/available/docker.completion.bash
completion/available/dotnet.completion.bash
Expand Down Expand Up @@ -130,18 +133,16 @@ plugins/available/pyenv.plugin.bash
plugins/available/python.plugin.bash
plugins/available/rbenv.plugin.bash
plugins/available/ruby.plugin.bash
plugins/available/sudo.plugin.bash
plugins/available/textmate.plugin.bash
plugins/available/thefuck.plugin.bash
plugins/available/todo.plugin.bash
plugins/available/url.plugin.bash
plugins/available/virtualenv.plugin.bash
plugins/available/xterm.plugin.bash
plugins/available/z_autoenv.plugin.bash
plugins/available/zoxide.plugin.bash

# tests
#
test/completion/aliases.completion.bats
test/run
test/test_helper.bash

# themes
#
themes/90210
Expand All @@ -163,6 +164,7 @@ themes/easy
themes/elixr
themes/essential
themes/githelpers.theme.bash
themes/gitline
themes/inretio
themes/lambda
themes/modern
Expand Down
33 changes: 17 additions & 16 deletions completion/available/capistrano.completion.bash
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
#!/usr/bin/env bash
# shellcheck shell=bash
# Bash completion support for Capistrano.

export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/}

_capcomplete() {
if [ -f Capfile ]; then
recent=`ls -t .cap_tasks~ Capfile **/*.cap 2> /dev/null | head -n 1`
if [[ $recent != '.cap_tasks~' ]]; then
cap --version | grep 'Capistrano v2.' > /dev/null
if [ $? -eq 0 ]; then
# Capistrano 2.x
cap --tool --verbose --tasks | cut -d " " -f 2 > .cap_tasks~
else
# Capistrano 3.x
cap --all --tasks | cut -d " " -f 2 > .cap_tasks~
fi
fi
COMPREPLY=($(compgen -W "`cat .cap_tasks~`" -- ${COMP_WORDS[COMP_CWORD]}))
return 0
fi
if [ -f Capfile ]; then
# shellcheck disable=SC2012
recent=$(ls -t .cap_tasks~ Capfile ./**/*.cap 2> /dev/null | head -n 1)
if [[ $recent != '.cap_tasks~' ]]; then
if cap --version | grep -q 'Capistrano v2.'; then
# Capistrano 2.x
cap --tool --verbose --tasks | cut -d " " -f 2 > .cap_tasks~
else
# Capistrano 3.x
cap --all --tasks | cut -d " " -f 2 > .cap_tasks~
fi
fi
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$(cat .cap_tasks~)" -- "${COMP_WORDS[COMP_CWORD]}"))
return 0
fi
}

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

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

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

return 0
return 0
}

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