summary refs log tree commit diff stats
path: root/hooks/post-up/emacs
diff options
context:
space:
mode:
authorAlan Pearce2017-03-06 19:12:56 +0100
committerAlan Pearce2017-03-06 19:12:56 +0100
commitf0f628fc2c99ee387dc729c09ebde77dc6ec9644 (patch)
treee0f8f69a3e7636a8e95ed777e5a2b4e7f9caa10a /hooks/post-up/emacs
parentf8d667341977a445fd701a07112b97896b0ce1f9 (diff)
downloadnixfiles-f0f628fc2c99ee387dc729c09ebde77dc6ec9644.tar.lz
nixfiles-f0f628fc2c99ee387dc729c09ebde77dc6ec9644.tar.zst
nixfiles-f0f628fc2c99ee387dc729c09ebde77dc6ec9644.zip
which -> command -v
http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script/677212#677212

TL;DR `command` is a POSIX-specified builtin. `which` is unreliable.
Diffstat (limited to 'hooks/post-up/emacs')
-rwxr-xr-xhooks/post-up/emacs2
1 files changed, 1 insertions, 1 deletions
diff --git a/hooks/post-up/emacs b/hooks/post-up/emacs
index 53de6dad..05a5c9d1 100755
--- a/hooks/post-up/emacs
+++ b/hooks/post-up/emacs
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-EMACS_COMMAND=$(which Emacs || which emacs)
+EMACS_COMMAND=$(command -v Emacs || command -v emacs)
 
 if [[ -s $EMACS_COMMAND ]]
 then