squish.lua

changeset 25
a4972a690064
parent 24
73ac55bcc19a
child 28
99ec02c56716
equal deleted inserted replaced
24:73ac55bcc19a 25:a4972a690064
95 end 95 end
96 -- -- -- -- -- -- -- --- -- -- -- -- -- -- -- -- 96 -- -- -- -- -- -- -- --- -- -- -- -- -- -- -- --
97 97
98 base_path = (base_path or "."):gsub("/$", "").."/" 98 base_path = (base_path or "."):gsub("/$", "").."/"
99 squishy_file = base_path .. "squishy"; 99 squishy_file = base_path .. "squishy";
100 out_fn = opts.output or "squished.out.lua"; 100 out_fn = opts.output;
101 101
102 local ok, err = pcall(dofile, squishy_file); 102 local ok, err = pcall(dofile, squishy_file);
103 103
104 if not ok then 104 if not ok then
105 print_err("Couldn't read squishy file: "..err); 105 print_err("Couldn't read squishy file: "..err);
106 os.exit(1);
107 end
108
109 if not out_fn then
110 print_err("No output file specified by user or squishy file");
111 os.exit(1);
112 elseif #main_files == 0 and #modules == 0 and #resources == 0 then
113 print_err("No files, modules or resources. Not going to generate an empty file.");
106 os.exit(1); 114 os.exit(1);
107 end 115 end
108 116
109 local fetch = {}; 117 local fetch = {};
110 function fetch.filesystem(path) 118 function fetch.filesystem(path)

mercurial