read from simple install field in package.json

pull/85/head
Ruben Daniels 2015-04-16 21:31:19 +00:00
rodzic 5edcde17bf
commit 03ef8db11a
2 zmienionych plików z 16 dodań i 10 usunięć

Wyświetl plik

@ -165,8 +165,8 @@ define(function(require, exports, module) {
// Start the installer if one is included // Start the installer if one is included
if (options.installer) { if (options.installer) {
addStaticPlugin("installer", name, options.installer.main, addStaticPlugin("installer", name, options.installer,
options.installer.version, resourceHolder); null, resourceHolder);
} }
next(); next();
@ -311,12 +311,21 @@ define(function(require, exports, module) {
services.newresource.addFileTemplate(data, plugin); services.newresource.addFileTemplate(data, plugin);
break; break;
case "installer": case "installer":
if (data) {
installer.createSession(pluginName, data, function(v, o){ installer.createSession(pluginName, data, function(v, o){
require([path], function(fn){ require([path], function(fn){
fn(v, o); fn(v, o);
}); });
}); });
} }
else {
require([path], function(fn){
installer.createSession(pluginName, fn.version, function(v, o){
fn(v, o);
});
});
}
}
} }
// Check if require.s.contexts._ can help watching all dependencies // Check if require.s.contexts._ can help watching all dependencies

Wyświetl plik

@ -16,10 +16,7 @@
"plugins": { "plugins": {
"example": {} "example": {}
}, },
"installer": { "installer": "install.js",
"main": "install.js",
"version": 1
},
"categories": [ "categories": [
"misc" "misc"
], ],