You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/helpers.sh
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -147,13 +147,16 @@ function error_and_proceed() {
147
147
export -f error_and_proceed;
148
148
149
149
functioncheck_dependencies() {
150
-
if [[ $(uname)=='Darwin' ]] && [ $(which brew) ];then
151
-
if! [ $(which ggrep) ];then
152
-
log 'error''A metaphysical dichotomy has caused this unit to overload and shut down. GNU Grep is a requirement and your Mac does not have it. Consider "brew install grep"';
150
+
if [[ $(uname)=='Darwin' ]];then
151
+
# If installed through brew, it will be available as `ggrep`, so we alias it to `grep`
152
+
ifcommand -v ggrep >/dev/null 2>&1;then
153
+
shopt -s expand_aliases;
154
+
alias grep=ggrep;
153
155
fi;
154
156
155
-
shopt -s expand_aliases;
156
-
alias grep=ggrep;
157
+
if! grep --version 2>&1| grep -q "GNU grep";then
158
+
log 'error''GNU Grep is a requirement and your Mac does not have it. Consider installing it with `brew install grep` or `nix profile install nixpkgs#gnugrep`';
0 commit comments