Shebangs added to compiled moonscript files.

- If an alternate installation directory is specified by hand,
	  however, no shebang will be added, because that file is likely
	  to be used as a module or some other sort of loadable code.
	- This is mostly a temporary workaround, because we need to be
	  more specific about what files need to receive a shebang and
	  what other files do not. auto[$target] could do the
	  distinction, though, but additional variables could be
	  preferable.
This commit is contained in:
Luka Vandervelden 2016-04-06 13:16:27 +02:00
parent b449ce07a3
commit 2024b1e1f9

View File

@ -17,14 +17,13 @@ function moon.build {
if [[ -n "${S}" ]]; then
write " ${S}"
write "\t@echo '$(MOON "${target}")'"
# write "\t@echo '$(SED "${basename}")'"
# write -n "\t${Q}sed -e '"
# write -n "s&@LIBDIR@&\$(LIBDIR)&;"
# write -n "s&@BINDIR@&\$(BINDIR)&;"
# write -n "s&@SHAREDIR@&\$(SHAREDIR)&;"
# write "' '${basename}.in' > '${basename}'"
if [[ -z "${install[$target]}" ]]; then
write "\t${Q}echo '#!/usr/bin/env lua' > '${target}'"
write "\t${Q}moonc -p $S >> '${target}'"
else
write "\t${Q}moonc -p $S > '${target}'"
# write "\t${Q}chmod +x '${basename}'"
write "\t${Q}chmod +x '${basename}'"
fi
fi
write "\n"