- local content, err = loader(plugin.."/"..resource);
- if not content then content, err = loader(resource); end
- -- TODO add support for packed plugins
-
- if not content and loader == load_file then
- return load_resource(plugin, resource, load_from_datastore);
- end
-
- return content, err;
-end
-
-function store_resource(plugin, resource, content, metadata)
- if not resource then
- resource = "mod_"..plugin..".lua";
- end
- local store = { content };
- if metadata then
- for k,v in pairs(metadata) do
- store[k] = v;
- end
- end
- datamanager.store(plugin.."/"..resource, "*", "plugins", store);