diogocavilha / fancy-git

That's a terminal prompt changer that shows a few cool git informations about your repository state. You can choose among different styles and enjoy all the aliases it provides you. Feel free for contributing, pull requests and issues are always welcome! ;)
GNU General Public License v2.0
477 stars 63 forks source link

NOT WORKING ON MAC BASH #149

Closed the-code-samurai-97 closed 9 months ago

the-code-samurai-97 commented 9 months ago
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
    [-e pattern] [-f file] [--binary-files=value] [--color=when]
    [--context[=num]] [--directories=action] [--label] [--line-buffered]
    [--null] [pattern] [file ...]

everytime its printing like this

bardpedersen commented 9 months ago

I hade the same problem, but solved it by following this thread:

https://github.com/Bash-it/bash-it/issues/1210

In the .fancy-git/modules/settings-manager.sh file change line 41. From:

    current_setting_value=$(grep -oP "(?<=$param_setting_name:).*" < "$FANCYGIT_CONFIG_FILE")

To

    current_setting_value=$(grep -o "(?<=$param_setting_name:).*" < "$FANCYGIT_CONFIG_FILE")

It seams that grep -P creates a problem for Mac, so just remove the "P" in the line works for me. Hope this helps.

the-code-samurai-97 commented 9 months ago

Thanks @bardpedersen