From d806d0c0aee1b51818558a34b5a151326c94f9aa Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Tue, 4 Apr 2023 15:09:51 -0700 Subject: [PATCH] launch-nw: Fix so it can be used as a symlink target This was its intended use--did I even test this?? --- launch-nw | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/launch-nw b/launch-nw index 9859171..ca5cd69 100755 --- a/launch-nw +++ b/launch-nw @@ -1,5 +1,7 @@ #!/bin/sh -${0%/*}/Emacs -nw "$@" +orig=`readlink $0` +: ${orig:=$0} # Otherwise you can't run it directly +${orig%/*}/Emacs -nw "$@" # Use this file as a symlink target to easily create a "terminal only" emacs: # ln -s /Applications/Emacs.app/Contents/MacOS/emacs-nw /usr/local/bin/emacs