From 98b310592a04eab09c9dcefd8dc3c8e4ca38e26c Mon Sep 17 00:00:00 2001 From: Arjan Steenbergen Date: Mon, 28 Oct 2024 11:16:33 +0100 Subject: [PATCH] Allow plugin force install --- components/plugin.js | 3 +++ tasks/plugin-add.js | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/components/plugin.js b/components/plugin.js index b1b5e5867..9f6975598 100644 --- a/components/plugin.js +++ b/components/plugin.js @@ -123,6 +123,9 @@ class Plugin { * Takes a plugin eg this or the result of Plugin.info and determines whether its a lando plugin or not */ static isValid(plugin) { + // if we are forcing installation then return true + if( plugin.config && plugin.config.force ) return true; + // if we are looking at a plugin instance then if (isClass(plugin.constructor) && plugin.constructor.name === 'Plugin') { return Object.keys(plugin.manifest).length > 0 || diff --git a/tasks/plugin-add.js b/tasks/plugin-add.js index 81ed14cb0..4c1875942 100644 --- a/tasks/plugin-add.js +++ b/tasks/plugin-add.js @@ -30,6 +30,11 @@ module.exports = lando => { array: true, default: [], }, + force: { + describe: 'Force install the plugin', + alias: ['f'], + type: 'boolean' + } }, run: async options => { const getPluginConfig = require('../utils/get-plugin-config'); @@ -42,6 +47,7 @@ module.exports = lando => { options.config = merge({}, [ getPluginConfig(lando.config.pluginConfigFile, lando.config.pluginConfig), lopts2Popts(options), + { force: !!options.force } ]); // reset Plugin static defaults for v3 purposes