From 747f3235520d97e0e1ee6112970781b2e8176cce Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 9 Jan 2021 19:29:30 -0500 Subject: [PATCH] checkPlugin: Use absolute path when installing `ep_etherpad-lite` This makes it possible to check plugins that were installed by symlinking into `node_modules/` like this: git clone git@github.com:ether/etherpad-lite.git git clone git@github.com:ether/ep_example.git cd etherpad-lite npm i ep_example@file:../ep_example node ./bin/checkPlugin.js ep_example --- bin/plugins/checkPlugin.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/plugins/checkPlugin.js b/bin/plugins/checkPlugin.js index 92d6271e..7bbad5bf 100755 --- a/bin/plugins/checkPlugin.js +++ b/bin/plugins/checkPlugin.js @@ -441,8 +441,10 @@ fs.readdir(pluginPath, (err, rootFiles) => { // if autoFix is enabled. const npmInstall = `npm install${autoFix ? '' : ' --no-package-lock'}`; execSync(npmInstall, {stdio: 'inherit'}); - // The ep_etherpad-lite peer dep must be installed last otherwise `npm install` will nuke it. - execSync(`${npmInstall} --no-save ep_etherpad-lite@file:../../src`, {stdio: 'inherit'}); + // The ep_etherpad-lite peer dep must be installed last otherwise `npm install` will nuke it. An + // absolute path to etherpad-lite/src is used here so that pluginPath can be a symlink. + execSync( + `${npmInstall} --no-save ep_etherpad-lite@file:${__dirname}/../../src`, {stdio: 'inherit'}); // linting begins try {