Syntax fix

This commit is contained in:
Kid 2021-01-08 18:10:25 +08:00
parent 9b9c0c8626
commit de8e87c7d0
3 changed files with 7 additions and 3 deletions

View File

@ -3,6 +3,8 @@
#: List all locally installable casks including short names.
#:
# Don't need shellcheck to follow the `source`.
# shellcheck disable=SC1090
source "$HOMEBREW_LIBRARY/Homebrew/items.sh"
homebrew-casks() {

View File

@ -3,6 +3,8 @@
#: List all locally installable formulae including short names.
#:
# Don't need shellcheck to follow the `source`.
# shellcheck disable=SC1090
source "$HOMEBREW_LIBRARY/Homebrew/items.sh"
homebrew-formulae() {

View File

@ -14,7 +14,7 @@ homebrew-items() {
items="$( \
find "$HOMEBREW_REPOSITORY/Library/Taps" \
-type d \( \
-name $find_filter -o \
-name "$find_filter" -o \
-name cmd -o \
-name .github -o \
-name lib -o \
@ -25,11 +25,11 @@ homebrew-items() {
sed "$sed_extended_regex_flag" \
-e 's/\.rb//g' \
-e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' \
-e $sed_filter \
-e "$sed_filter" \
)"
local shortnames
shortnames="$(echo "$items" | cut -d "/" -f 3)"
echo -e "$items\n$shortnames" | \
grep -v $grep_filter | \
grep -v "$grep_filter" | \
sort -uf
}