From 3651b9484fa2179eeeba0d41263fc4a51e467e65 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Fri, 6 Nov 2020 09:17:52 +1000 Subject: [PATCH] Fix for pip install error when there are no plugins to install --- backend/setup.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/backend/setup.js b/backend/setup.js index 2a5ba969..d58a1606 100644 --- a/backend/setup.js +++ b/backend/setup.js @@ -187,11 +187,17 @@ const setupCertbotPlugins = () => { } }); - const install_cmd = 'pip3 install ' + plugins.join(' '); - promises.push(utils.exec(install_cmd)); - return Promise.all(promises).then(() => { - logger.info('Added Certbot plugins ' + plugins.join(', ')); - }); + if (plugins.length) { + const install_cmd = 'pip3 install ' + plugins.join(' '); + promises.push(utils.exec(install_cmd)); + } + + if (promises.length) { + return Promise.all(promises) + .then(() => { + logger.info('Added Certbot plugins ' + plugins.join(', ')); + }); + } } }); };