Closed brightgong closed 6 years ago
In the ejf
binary sed -re
is invoked, but the BSD-style should be sed -Ee
. Anyway I get a runtime exception in the main when running the formatter directly from the command line.
The problem is that -executable is GNU specific. This thread on StackExchange gives the alternative that should work in both systems. I tried this change and the change for sed as indicated by @rvvincelli and it works on my mac. I haven't been able to test it on a Linux machines though.
Would any of you care to submit a PR, that works on both systems, GNU, and the other one? :grin:
a quick fix:
vim git-hooks/tools/eclipse-java-formatter/ejf
sed -re
to sed -Ee
I see in the GNU sed’s manual:
-E, -r, --regexp-extended
use extended regular expressions in the script (for
portability use POSIX -E).
… so we can just switch to -Ee
everywhere.
Since I don’t have a non-GNU system to test, it would be optimal if someone else did a PR, but here it goes:
(And that -executable
bit was fixed in #10.)
I use this hook on my mac and it didn't work when i done everything written in README step by step.
The error is: find: -executable: unknown primary or operator
did i make mistake on somewhere?