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.
master
Luka Vandervelden 2016-04-06 13:16:27 +02:00
parent b449ce07a3
commit 2024b1e1f9
1 changed files with 7 additions and 8 deletions

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}'"
write "\t${Q}moonc -p $S > '${target}'"
# write "\t${Q}chmod +x '${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}'"
fi
fi
write "\n"