File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5050 brew update
5151 brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true
5252
53- # Add shell completions generation before the closing "end" of the install method
53+ # Add shell completions generation after the last bin. install line
5454 if ! grep -q 'generate_completions_from_executable' "Formula/${filename}"; then
55- sed -i '/^ end$/i\ generate_completions_from_executable(bin/"hotdata", "completions")' "Formula/${filename}"
55+ last_bin_install=$(grep -n 'bin\.install' "Formula/${filename}" | tail -1 | cut -d: -f1)
56+ if [ -n "$last_bin_install" ]; then
57+ sed -i "${last_bin_install}a\\ generate_completions_from_executable(bin/\"hotdata\", \"completions\")" "Formula/${filename}"
58+ fi
5659 fi
5760
5861 git add "Formula/${filename}"
You can’t perform that action at this time.
0 commit comments