squish.lua

changeset 25
a4972a690064
parent 24
73ac55bcc19a
child 28
99ec02c56716
--- a/squish.lua	Sun Jul 26 14:45:13 2009 +0100
+++ b/squish.lua	Sun Jul 26 14:45:45 2009 +0100
@@ -97,7 +97,7 @@
 
 base_path = (base_path or "."):gsub("/$", "").."/"
 squishy_file = base_path .. "squishy";
-out_fn = opts.output or "squished.out.lua";
+out_fn = opts.output;
 
 local ok, err = pcall(dofile, squishy_file);
 
@@ -106,6 +106,14 @@
 	os.exit(1);
 end
 
+if not out_fn then
+	print_err("No output file specified by user or squishy file");
+	os.exit(1);
+elseif #main_files == 0 and #modules == 0 and #resources == 0 then
+	print_err("No files, modules or resources. Not going to generate an empty file.");
+	os.exit(1);
+end
+
 local fetch = {};
 function fetch.filesystem(path)
 	local f, err = io.open(path);

mercurial