squish.lua: Add --list-missing-files option

Thu, 31 Dec 2015 20:29:08 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 31 Dec 2015 20:29:08 +0000
changeset 91
4608c7c025e5
parent 90
b9470a7655b4
child 92
55e927a6c228

squish.lua: Add --list-missing-files option

squish.lua file | annotate | diff | comparison | revisions
--- a/squish.lua	Thu Dec 31 20:28:50 2015 +0000
+++ b/squish.lua	Thu Dec 31 20:29:08 2015 +0000
@@ -203,9 +203,16 @@
 	end
 end
 
-if opts.list_files then
-	local function write(text)
-		io.write(text, "\n");
+if opts.list_files or opts.list_missing_files then
+	local function write(filename)
+		if opts.list_missing_files then
+	                local f = io.open(filename);
+	                if f then
+	                	f:close();
+	                	return;
+	                end		
+		end
+		io.write(filename, "\n");
 	end
 	for _, fn in pairs(main_files) do
 		write(fn);

mercurial