mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
bin scripts: Promisify npm.load
This commit is contained in:
parent
92cd2cc760
commit
efdcaae526
7 changed files with 39 additions and 23 deletions
|
@ -7,15 +7,18 @@
|
|||
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
||||
process.on('unhandledRejection', (err) => { throw err; });
|
||||
|
||||
const npm = require('ep_etherpad-lite/node_modules/npm');
|
||||
const util = require('util');
|
||||
|
||||
if (process.argv.length !== 3) throw new Error('Use: node bin/checkPad.js $PADID');
|
||||
|
||||
// get the padID
|
||||
const padId = process.argv[2];
|
||||
let checkRevisionCount = 0;
|
||||
|
||||
// load and initialize NPM;
|
||||
const npm = require('ep_etherpad-lite/node_modules/npm');
|
||||
npm.load({}, async () => {
|
||||
(async () => {
|
||||
await util.promisify(npm.load)({});
|
||||
|
||||
try {
|
||||
// initialize database
|
||||
require('ep_etherpad-lite/node/utils/Settings');
|
||||
|
@ -86,4 +89,4 @@ npm.load({}, async () => {
|
|||
console.trace(err);
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue