squish.lua: Only prepend project base path for relative paths specified in the squishy file

Fri, 06 Aug 2010 20:17:46 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Fri, 06 Aug 2010 20:17:46 +0100
changeset 71
e27ab4492cdd
parent 70
0fd43db11abc
child 72
00d72b0f2e7c

squish.lua: Only prepend project base path for relative paths specified in the squishy file

squish.lua file | annotate | diff | comparison | revisions
--- a/squish.lua	Thu Jul 08 01:14:51 2010 +0100
+++ b/squish.lua	Fri Aug 06 20:17:46 2010 +0100
@@ -215,7 +215,10 @@
 
 print_verbose("Packing modules...");
 for _, module in ipairs(modules) do
-	local modulename, path = module.name, base_path..module.path;
+	local modulename, path = module.name, module.path;
+	if module.path:sub(1,1) ~= "/" then
+		path = base_path..module.path;
+	end
 	print_debug("Packing "..modulename.." ("..path..")...");
 	local data, err = fetch.filesystem(path);
 	if (not data) and module.url then

mercurial