You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 3, 2018. It is now read-only.
In reviewing ClojureX today on my commute home from work (in preparation for the rubylearning.org Clojure101 course,) I found and fixed a couple of small bugs in the 'clj' script.
First, clj didn't actually select rlwrap instead of jline like it promised it would. The problem was a typo in the avail function. Second, if clj is a relative symlink (e.g. bin/clj -> ../work/ClojureX/clj) it will not correctly determine the path because readlink fails to canonicalize the link.
diff --git a/clj b/clj
index b3000e7..5c188c5 100755
--- a/clj
+++ b/clj
@@ -14,7 +14,7 @@ USAGE="Usage: $PRG_NAME [java-opt*] [init-opt*] [main-opt] [arg*]"
# determine if $1 is an available program (eschew 'which', as it's unreliable)
avail() {
- type -P $1 $>/dev/null
+ type -P $1 &>/dev/null
}
# send the stock usage text to stderr
@@ -68,7 +68,7 @@ PRG="$0"
while [ -h "$PRG" ]; do
# if readlink is availble, use it; it is less fragile than relying on `ls` output
if avail readlink; then
- PRG=`readlink "$PRG"`
+ PRG=`readlink -f "$PRG"`
else
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
The text was updated successfully, but these errors were encountered:
Unfortunately the -f option breaks readlink on OSX. Since that always has been ClojureX's main platform, I had to remove it for the time being. Will have to implement some platform neutral way to determine the canonical path. The joys of cross-platform shell scripting...
In reviewing ClojureX today on my commute home from work (in preparation for the rubylearning.org Clojure101 course,) I found and fixed a couple of small bugs in the 'clj' script.
First, clj didn't actually select rlwrap instead of jline like it promised it would. The problem was a typo in the avail function. Second, if clj is a relative symlink (e.g. bin/clj -> ../work/ClojureX/clj) it will not correctly determine the path because readlink fails to canonicalize the link.
The text was updated successfully, but these errors were encountered: