29 if opts.verbose or opts.very_verbose then print_verbose = print; end |
29 if opts.verbose or opts.very_verbose then print_verbose = print; end |
30 if opts.very_verbose then print_debug = print; end |
30 if opts.very_verbose then print_debug = print; end |
31 |
31 |
32 print = print_verbose; |
32 print = print_verbose; |
33 |
33 |
34 local enable_debug = opts.enable_debug; |
|
35 |
|
36 local modules, main_files, resources = {}, {}, {}; |
34 local modules, main_files, resources = {}, {}, {}; |
37 |
35 |
38 -- Functions to be called from squishy file -- |
36 -- Functions to be called from squishy file -- |
39 |
37 |
40 function Module(name) |
38 function Module(name) |
224 end |
222 end |
225 if data then |
223 if data then |
226 f:write("package.preload['", modulename, "'] = (function (...)\n"); |
224 f:write("package.preload['", modulename, "'] = (function (...)\n"); |
227 f:write(data); |
225 f:write(data); |
228 f:write("end)\n"); |
226 f:write("end)\n"); |
229 if enable_debug then |
227 if opts.debug then |
230 f:write(string.format("package.preload[%q] = ___adjust_chunk(package.preload[%q], %q);\n\n", |
228 f:write(string.format("package.preload[%q] = ___adjust_chunk(package.preload[%q], %q);\n\n", |
231 modulename, modulename, "@"..path)); |
229 modulename, modulename, "@"..path)); |
232 end |
230 end |
233 else |
231 else |
234 print_err("Couldn't pack module '"..modulename.."': "..err); |
232 print_err("Couldn't pack module '"..modulename.."': "..err); |