<NME> lumen
<BEF> #!/bin/sh

dir="$(pwd)"
cd "$(dirname "$0")"
home="$(pwd)"
cd "${dir}"

if [ ! -z "${LUMEN_HOST}" ]
then
    host="${LUMEN_HOST}"
elif luajit -v > /dev/null 2>&1
then
    host=luajit
elif lua -v > /dev/null 2>&1
then
    host=lua
elif node -v > /dev/null 2>&1
then
    host=node
else
    echo no host found
fi

case $host in
    node*)
        code=lumen.js
        export NODE_PATH="$NODE_PATH:${home}:${dir}/lib:${dir}/node_modules";;
    *)
        code=lumen.lua
        export LUA_PATH="$LUA_PATH;${home}/?.lua;${dir}/lib/?.lua;;";;
esac

exec ${host} "${home}/${code}" "$@"

<MSG> Support symlinks to bin/lumen

<DFF> @@ -1,7 +1,14 @@
 #!/bin/sh
 
 dir="$(pwd)"
-cd "$(dirname "$0")"
+bin="$0"
+while [ -L "${bin}" ]
+do
+  x="$(readlink "${bin}")"
+  cd "$(dirname "${bin}")"
+  bin="${x}"
+done
+cd "$(dirname "${bin}")"
 home="$(pwd)"
 cd "${dir}"
 

{'addition_count': 8, 'commit_subject': 'Support symlinks to bin/lumen', 'deletion_count': 1, 'file_extension': '', 'lang': 'lumen', 'license': 'bsd-2-clause', 'repo_name': 'sctb/lumen'}