checkPlugin: cd to Etherpad root dir

pull/5425/head
Richard Hansen 2022-02-20 17:44:06 -05:00
parent 5a66abae8b
commit d9044537bb
1 changed files with 6 additions and 0 deletions

View File

@ -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');