squish.lua

changeset 82
4d6a976c3bb7
parent 81
44f2945d09cf
child 83
ff14c066a643
equal deleted inserted replaced
81:44f2945d09cf 82:4d6a976c3bb7
227 if (not data) and module.url then 227 if (not data) and module.url then
228 local url = module.url:gsub("%?", module.path); 228 local url = module.url:gsub("%?", module.path);
229 print_debug("Fetching: ".. url) 229 print_debug("Fetching: ".. url)
230 if url:match("^https?://") then 230 if url:match("^https?://") then
231 data, err = fetch.http(url); 231 data, err = fetch.http(url);
232 elseif url:match("^file://") then 232 elseif url:match("^file://") or url:match("^[/%.]") then
233 local dataf, dataerr = io.open((url:gsub("^file://", ""))); 233 local dataf, dataerr = io.open((url:gsub("^file://", "")));
234 if dataf then 234 if dataf then
235 data, err = dataf:read("*a"); 235 data, err = dataf:read("*a");
236 dataf:close(); 236 dataf:close();
237 else 237 else

mercurial