-
-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathnelua
More file actions
executable file
·25 lines (22 loc) · 610 Bytes
/
nelua
File metadata and controls
executable file
·25 lines (22 loc) · 610 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# implement realpath case it's not present (Mac OS X for example)
if ! [ -x "$(command -v realpath)" ]; then
realpath() {
OURPWD=$PWD
cd "$(dirname "$1")"
LINK=$(readlink "$(basename "$1")")
while [ "$LINK" ]; do
cd "$(dirname "$LINK")"
LINK=$(readlink "$(basename "$1")")
done
REALPATH="$PWD/$(basename "$1")"
cd "$OURPWD"
echo "$REALPATH"
}
fi
# detect the current directory for this script
SCRIPT=$(realpath "$0")
SCRIPT_DIR=$(dirname "$SCRIPT")
NELUA_LUA="$SCRIPT_DIR/nelua-lua"
# execute nelua compiler
exec "$NELUA_LUA" -lnelua nelua.lua "$@"