squish.lua: Add --list-files option, which lists out all files required by the squishy file (with the passed command-line options)

Thu, 31 Dec 2015 20:02:17 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 31 Dec 2015 20:02:17 +0000
changeset 88
60e10cf9b20c
parent 87
f39aceada1ad
child 89
23dbca856f92

squish.lua: Add --list-files option, which lists out all files required by the squishy file (with the passed command-line options)

squish.lua file | annotate | diff | comparison | revisions
--- a/squish.lua	Thu Dec 31 20:01:15 2015 +0000
+++ b/squish.lua	Thu Dec 31 20:02:17 2015 +0000
@@ -196,6 +196,23 @@
 	end
 end
 
+print(opts.list_files)
+if opts.list_files then
+	local function write(text)
+		io.write(text, "\n");
+	end
+	for _, fn in pairs(main_files) do
+		write(fn);
+	end
+	for _, module in ipairs(modules) do
+		write(module.path);
+	end
+	for _, resource in ipairs(resources) do
+		write(resource.path);
+	end
+	return;
+end
+
 print_info("Writing "..out_fn.."...");
 local f, err = io.open(out_fn, "w+");
 if not f then

mercurial