Remove shebangs from modules, if any (thanks Markus Stenberg)

Tue, 27 Nov 2012 08:25:18 -0800

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 27 Nov 2012 08:25:18 -0800
changeset 86
2322f7932064
parent 85
347ac1733354
child 87
f39aceada1ad

Remove shebangs from modules, if any (thanks Markus Stenberg)

squish.lua file | annotate | diff | comparison | revisions
--- a/squish.lua	Fri Jul 13 17:14:22 2012 +0100
+++ b/squish.lua	Tue Nov 27 08:25:18 2012 -0800
@@ -236,6 +236,7 @@
 		end
 	end
 	if data then
+		data = data:gsub("^#[^\r\n]*\r?\n", ""); -- Remove shebang if any (or we can't concat)
 		if not opts.debug then
 			f:write("package.preload['", modulename, "'] = (function (...)\n");
 			f:write(data);

mercurial