[PATCH 4/5] Notify the user if getopt is not installed

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


In the past commits we implemented a new way to find gnu-getopt on macOS.
If we can not find it, pass can not be used, thus the user should be
notified about this.
---
 src/platform/darwin.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh
index 1d9ac8f..a9d32ce 100644
--- a/src/platform/darwin.sh
+++ b/src/platform/darwin.sh
@@ -47,5 +47,10 @@ GETOPT="$(PATH="/usr/local/opt/gnu-getopt/bin:/opt/local/bin:/usr/local/bin" com
 GETOPT="$(brew --prefix 2>/dev/null)/opt/gnu-getopt/bin/getopt" || \
 GETOPT="$(port content getopt | grep -E '/s?bin/')"
 
+if [ ! $GETOPT ]; then
+	echo "'getopt' is not installed. Please use 'brew' or 'port' to install it."
+	exit 1
+fi
+
 SHRED="srm -f -z"
 BASE64="openssl base64"
-- 
2.17.1 (Apple Git-112)



More information about the Password-Store mailing list