Skip to content

Commit

Permalink
🔨 Improve grep command
Browse files Browse the repository at this point in the history
Grep command crashes on MAC OS when using the "-P" parameter.
So a couple of grep commands inside the fancygit core have been changed in order to fix that.

closes #47
  • Loading branch information
diogocavilha committed Dec 1, 2019
1 parent b11849f commit 4846862
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Fancy Git Changelog

### v6.2.6
### v6.2.7

- Add `human-single-line` style.
- Add `human-dark-single-line` style.
- Fix some bugs with `grep` command when using MAC OS.

### v6.1.6

Expand Down
6 changes: 3 additions & 3 deletions commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ _fg_copy_style_from_mode_file_to_app_config() {
_fg_safetly_remove_mode_file() {
local app_config_file_status

app_config_file_status=`grep -ioP 'fresh_file' < ~/.fancy-git/app_config`
app_config_file_status=`grep -io 'fresh_file' < ~/.fancy-git/app_config`

if [ "$app_config_file_status" = "fresh_file"]; then
sed -i '/fresh_file/d' ~/.fancy-git/app_config
Expand Down Expand Up @@ -161,9 +161,9 @@ fg_show_app_config() {
fg_show_full_path() {
local show_full_path=""

show_full_path=$(grep -oP '(?<=show-full-path:).*' < ~/.fancy-git/app_config)
show_full_path=$(grep -o 'show-full-path:false' < ~/.fancy-git/app_config)

if [ "$show_full_path" = "false" ]; then
if [ "$show_full_path" = "show-full-path:false" ]; then
return 1
fi

Expand Down

0 comments on commit 4846862

Please sign in to comment.