mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
Make the server restart on plugin install
This commit is contained in:
parent
3338db9485
commit
b438a278a1
5 changed files with 85 additions and 47 deletions
|
@ -3,7 +3,7 @@ var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");
|
|||
var npm = require("npm");
|
||||
var registry = require("npm/lib/utils/npm-registry-client/index.js");
|
||||
|
||||
var withNpm = function (npmfn, cb) {
|
||||
var withNpm = function (npmfn, final, cb) {
|
||||
npm.load({}, function (er) {
|
||||
if (er) return cb({progress:1, error:er});
|
||||
npm.on("log", function (message) {
|
||||
|
@ -15,6 +15,7 @@ var withNpm = function (npmfn, cb) {
|
|||
data.progress = 1;
|
||||
data.message = "Done.";
|
||||
cb(data);
|
||||
final();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -36,6 +37,9 @@ exports.uninstall = function(plugin_name, cb) {
|
|||
});
|
||||
});
|
||||
},
|
||||
function () {
|
||||
hooks.aCallAll("restartServer", {}, function () {});
|
||||
},
|
||||
cb
|
||||
);
|
||||
};
|
||||
|
@ -51,6 +55,9 @@ exports.install = function(plugin_name, cb) {
|
|||
});
|
||||
});
|
||||
},
|
||||
function () {
|
||||
hooks.aCallAll("restartServer", {}, function () {});
|
||||
},
|
||||
cb
|
||||
);
|
||||
};
|
||||
|
@ -93,6 +100,7 @@ exports.search = function(query, cache, cb) {
|
|||
}
|
||||
);
|
||||
},
|
||||
function () { },
|
||||
cb
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue