commit 07b169ec32ad6961ed8625a0b932a663abcb01d2 parent 8d267c480e1f04832bd6110e73411dee63bbf042 Author: Filippo Valsorda <hi@filippo.io> Date: Sun, 19 Apr 2020 18:55:05 -0400 platform/darwin: don't invoke brew for the default prefix "brew --prefix gnu-getopt" takes 2.125s on my very default setup (I don't even want to know why), dominating the pass wall time. If the default brew prefix is in use, just detect the getopt binary with a cheap "test -x" instead. Diffstat:
M | src/platform/darwin.sh | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh @@ -39,6 +39,6 @@ qrcode() { fi } -GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || { which port &>/dev/null && echo /opt/local; } || echo /usr/local)/bin/getopt" +GETOPT="$({ test -x /usr/local/opt/gnu-getopt/bin/getopt && echo /usr/local/opt/gnu-getopt; } || brew --prefix gnu-getopt 2>/dev/null || { which port &>/dev/null && echo /opt/local; } || echo /usr/local)/bin/getopt" SHRED="srm -f -z" BASE64="openssl base64"