# HG changeset patch # User Matthew Wild # Date 1248615945 -3600 # Node ID a4972a690064153e3463f5c3c496c891cd52e532 # Parent 73ac55bcc19abd6be26259df9600d3a2f1a7e8fc Complain if output file not specified, or if squish would generate an empty file diff -r 73ac55bcc19a -r a4972a690064 squish.lua --- 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);