Skip to content
Snippets Groups Projects
Unverified Commit 275227c9 authored by Maxim Belkin's avatar Maxim Belkin Committed by GitHub
Browse files

Merge pull request #9389 from MikeMcQuaid/formulae_sed_extended_regex_flag

formulae: fix sed extended regex flag on macOS.
parents d0feb49a 7c309ee7
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,14 @@
homebrew-formulae() {
local formulae
local sed_extended_regex_flag
if [[ -n "$HOMEBREW_MACOS" ]]; then
sed_extended_regex_flag="-E"
else
sed_extended_regex_flag="-r"
fi
formulae="$( \
find "$HOMEBREW_REPOSITORY/Library/Taps" \
-type d \( \
......@@ -16,9 +24,10 @@ homebrew-formulae() {
-name vendor \
\) \
-prune -false -o -name '*\.rb' | \
sed -r -e 's/\.rb//g' \
-e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' \
-e 's|/Formula/|/|' \
sed "$sed_extended_regex_flag" \
-e 's/\.rb//g' \
-e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' \
-e 's|/Formula/|/|' \
)"
local shortnames
shortnames="$(echo "$formulae" | cut -d "/" -f 3)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment