internetguru / flow

Use Git Flow with ease – maintain branches, semantic versioning, releases, and changelog with a single command.
Other
41 stars 6 forks source link

omgf not working on macOS HighSierra #81

Closed jakubdibala closed 1 year ago

jakubdibala commented 6 years ago

When I run omgf --what-now, omgf displays this error:

➜  git-flow-example git:(master) ✗ omgf --what-now
omgf[error]: OMGF requires Bash version 3.2 or later (you have no Bash installed)
omgf[error]: Generic error occurred (see REPORTING BUGS).

I tried preinstalled Bash (3.2.57):

➜  git-flow-example git:(master) ✗ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)
Copyright (C) 2007 Free Software Foundation, Inc.

I tried upgrade via homebrew to Bash (4.4.23):

➜  git-flow-example git:(master) ✗ bash --version
GNU bash, verze 4.4.23(1)-release (x86_64-apple-darwin17.5.0)
Copyright (C) 2016 Free Software Foundation, Inc.
Licence GPLv3+: GNU GPL verze 3 nebo novější <http://gnu.org/licenses/gpl.html>

Toto je svobodné programové vybavení: máte právo jej měnit a šířit.
VEŠKERÉ ZÁRUKY chybí, jak jen zákon dovoluje.

I have installed all required dependencies. Even when I comment out requirements checking code, I got omgf[error]: Generic error occurred (see REPORTING BUGS).

jnv commented 4 years ago

@petrzpav I second this one issue, the problem is still persistent on macOS Catalina. I dug a bit deeper and pinpointed the issue to parse_version function:

https://github.com/InternetGuru/omgf/blob/fd9dc6ea6d2337c60585003c7316d262f8e82313/omgf#L361-L363

Running this directly against Bash or Git gives an empty result:

$ bash --version | sed -n 's/.*\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p'
$

But when I use GNU Sed, installed from Homebrew, it works:

$ bash --version | gsed -n 's/.*\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p'                                                                                                            
9.5.0
$

So the solution here is to either fix the regex to work with BSD sed, or to check for alias for gsed and use it if it is available; I think the latter option would be easier since GNU Sed is already a prerequisite and you won't need to fix other regexps.

jiripavelka commented 1 year ago

It's been a while. The whole tool has been reimplemented. This issue should be fixed. I'm sure there will be more regarding mac compatibility. Thank you for your interest!