[PATCH 1/5] Use three assumed default paths for gnu-getopt lookup

Artur Sterz pass-maillinglist at artursterz.de
Tue Oct 30 18:06:24 CET 2018


brew --prefix gnu-getopt will allways make some git lookups which may take
longer, depending on your internet connectivity. We therefore first look
in some default location for gnu-getopt. If it is not found there, make
the regular lookup.
---
 src/platform/darwin.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh
index 342ecce..e00b928 100644
--- a/src/platform/darwin.sh
+++ b/src/platform/darwin.sh
@@ -43,6 +43,9 @@ qrcode() {
 	fi
 }
 
-GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || { which port &>/dev/null && echo /opt/local; } || echo /usr/local)/bin/getopt"
+GETOPT="$(PATH="/usr/local/opt/gnu-getopt/bin:/opt/local/bin:/usr/local/bin" command -v getopt)" || \
+GETOPT="$(brew --prefix gnu-getopt 2>/dev/null)/bin/getopt" || \
+GETOPT="$(which port &>/dev/null && echo /opt/local/bin/getopt)"
+
 SHRED="srm -f -z"
 BASE64="openssl base64"
-- 
2.17.1 (Apple Git-112)



More information about the Password-Store mailing list