From e21b5130cf5246c5d31c2c6c4684188f413e55b8 Mon Sep 17 00:00:00 2001 From: SamTv12345 Date: Fri, 12 Jul 2024 08:34:53 +0200 Subject: [PATCH] Fixed checkPad script not returning --- bin/checkPad.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/checkPad.ts b/bin/checkPad.ts index 09f3d30c5..a35e08ea7 100644 --- a/bin/checkPad.ts +++ b/bin/checkPad.ts @@ -11,12 +11,19 @@ process.on('unhandledRejection', (err) => { throw err; }); if (process.argv.length !== 3) throw new Error('Use: node bin/checkPad.js $PADID'); // @ts-ignore const padId = process.argv[2]; -(async () => { + +const performCheck = async () => { const db = require('ep_etherpad-lite/node/db/DB'); await db.init(); + console.log("Checking if " + padId + " exists") const padManager = require('ep_etherpad-lite/node/db/PadManager'); if (!await padManager.doesPadExists(padId)) throw new Error('Pad does not exist'); const pad = await padManager.getPad(padId); await pad.check(); - console.log('Finished.'); -})(); + console.log('Finished checking pad.'); + process.exit(0) +} + +performCheck() + .then(e=>console.log("Finished")) + .catch(e=>console.log("Finished with errors"))