diff --git a/src/bin/plugins/checkPlugin.js b/src/bin/plugins/checkPlugin.js index 85f626e2f..d5a3cfaef 100755 --- a/src/bin/plugins/checkPlugin.js +++ b/src/bin/plugins/checkPlugin.js @@ -10,6 +10,8 @@ * node src/bin/plugins/checkPlugin.js ep_whatever autopush */ +const process = require('process'); + // As of v14, Node.js does not exit when there is an unhandled Promise rejection. Convert an // unhandled rejection into an uncaught exception, which does cause Node.js to exit. process.on('unhandledRejection', (err) => { throw err; }); @@ -30,6 +32,10 @@ const path = require('path'); console.log(`Checking the plugin: ${pluginName}`); + const epRootDir = await fsp.realpath(path.join(await fsp.realpath(__dirname), '../../..')); + console.log(`Etherpad root directory: ${epRootDir}`); + process.chdir(epRootDir); + const optArgs = process.argv.slice(3); const autoPush = optArgs.includes('autopush'); const autoCommit = autoPush || optArgs.includes('autocommit');