Skip to content

Commit 055c898

Browse files
author
Ira Abramov
committed
re-fixing. thanks to @akinomyoga and his keen eyes...
1 parent 48b817e commit 055c898

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ repos:
1919
hooks:
2020
- id: git-check # Configure in .gitattributes
2121
- id: shellcheck
22+
files: "\\.(bash)$"
2223
- id: shfmt
2324
- repo: https://github.com/Lucas-C/pre-commit-hooks
2425
rev: v1.1.7
@@ -38,7 +39,7 @@ repos:
3839
name: Check .bash files against bash-it requirements
3940
entry: ./hooks/dot-bash.sh
4041
language: system
41-
files: "\\.(bash|bats)$"
42+
files: "\\.(bash)$"
4243
types: [file]
4344
- id: clean-files-txt
4445
name: Check that clean_files.txt is sorted alphabetically.

plugins/available/fzf.plugin.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ fe() {
2828

2929
local IFS=$'\n'
3030
local files
31-
IFS=" " read -r -a files --query="$1" --multi --select-1 --exit-0 <<< fzf-tmux
32-
[[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}"
31+
mapfile -t files <<< "$(fzf-tmux --query="$1" --multi --select-1 --exit-0)"
32+
[[ -n "${files[0]}" ]] && "${EDITOR:-vim}" "${files[@]}"
3333
}
3434

3535
fcd() {

plugins/available/pack.plugin.bash

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ __pack_handle_reply() {
5050
else
5151
allflags=("${flags[*]} ${two_word_flags[*]}")
5252
fi
53-
IFS=" " read -r -a COMPREPLY <<< "$(compgen -W "${allflags[*]}" -- "$cur")"
53+
mapfile -t COMPREPLY <<< "$(compgen -W "${allflags[*]}" -- "$cur")"
5454
if [[ $(type -t compopt) = "builtin" ]]; then
5555
[[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace
5656
fi
@@ -100,10 +100,10 @@ __pack_handle_reply() {
100100
if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then
101101
completions+=("${must_have_one_flag[@]}")
102102
fi
103-
IFS=" " read -r -a COMPREPLY <<< "$(compgen -W "${completions[*]}" -- "$cur")"
103+
mapfile -t COMPREPLY <<< "$(compgen -W "${completions[*]}" -- "$cur")"
104104

105105
if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then
106-
IFS=" " read -r -a COMPREPLY <<< "$(compgen -W "${noun_aliases[*]}" -- "$cur")"
106+
mapfile -t COMPREPLY <<< "$(compgen -W "${noun_aliases[*]}" -- "$cur")"
107107
fi
108108

109109
if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
@@ -130,7 +130,7 @@ __pack_handle_filename_extension_flag() {
130130

131131
__pack_handle_subdirs_in_dir_flag() {
132132
local dir="$1"
133-
pushd "${dir}" > /dev/null 2>&1 && _filedir -d && popd || return 1 > /dev/null 2>&1
133+
pushd "${dir}" > /dev/null 2>&1 && _filedir -d && popd > /dev/null 2>&1 || return 1
134134
}
135135

136136
__pack_handle_flag() {
@@ -568,8 +568,8 @@ _pack_root_command() {
568568

569569
__start_pack() {
570570
local cur prev words cword
571+
#shellcheck disable=SC2034
571572
declare -A flaghash 2> /dev/null || :
572-
export flaghash
573573
declare -A aliashash 2> /dev/null || :
574574
if declare -F _init_completion > /dev/null 2>&1; then
575575
_init_completion -s || return

vendor/github.com/rcaloras/bash-preexec/test/include-test.bats

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)