aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/platform/darwin.sh
diff options
context:
space:
mode:
authorAyush Agarwal <ayush@fastmail.in>2021-09-15 22:47:27 +0530
committerJason A. Donenfeld <Jason@zx2c4.com>2021-09-23 15:25:28 -0600
commita80a3189458a86f29f61d980b4ad977594199864 (patch)
treeb2473c0fb7b5498c2a32355b9de369391aa1b192 /src/platform/darwin.sh
parentDefault to xclip if wl-clip is not found (diff)
downloadpassword-store-a80a3189458a86f29f61d980b4ad977594199864.tar.xz
password-store-a80a3189458a86f29f61d980b4ad977594199864.zip
Replace 'which' with POSIX equivalent 'command -v'
The 'which' command is an external command that must be called each and every time pass is used. 'which' is also not mentioned in the README as one of the dependencies that might be needed to run pass. Instead of 'which', we can use the POSIX compatible and shell built-in 'command -v'. It saves pass from making an external call and is, arguably, more reliable than using 'which' as mentioned in the following link.
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 f6cc471..9a1fda8 100644
--- a/src/platform/darwin.sh
+++ b/src/platform/darwin.sh
@@ -39,6 +39,6 @@ qrcode() {
fi
}
-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"
+GETOPT="$({ test -x /usr/local/opt/gnu-getopt/bin/getopt && echo /usr/local/opt/gnu-getopt; } || brew --prefix gnu-getopt 2>/dev/null || { command -v port &>/dev/null && echo /opt/local; } || echo /usr/local)/bin/getopt"
SHRED="srm -f -z"
BASE64="openssl base64"