summaryrefslogtreecommitdiff
path: root/src/platform/darwin.sh
diff options
context:
space:
mode:
authorFilippo Valsorda <hi@filippo.io>2020-04-19 18:55:05 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2020-04-19 23:36:59 -0600
commit07b169ec32ad6961ed8625a0b932a663abcb01d2 (patch)
tree037e4e456f9e8493fa569b16a80aae21a8a87322 /src/platform/darwin.sh
parent8d267c480e1f04832bd6110e73411dee63bbf042 (diff)
downloadpass-07b169ec32ad6961ed8625a0b932a663abcb01d2.tar.gz
pass-07b169ec32ad6961ed8625a0b932a663abcb01d2.tar.bz2
pass-07b169ec32ad6961ed8625a0b932a663abcb01d2.zip
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 (limited to 'src/platform/darwin.sh')
-rw-r--r--src/platform/darwin.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh
index 1222040..f6cc471 100644
--- 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"