Skip to content

Allow plugin force install #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions components/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
* 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;

Check failure on line 127 in components/plugin.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Expected space(s) after "if"

Check failure on line 127 in components/plugin.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Expected space(s) after "if"

Check failure on line 127 in components/plugin.js

View workflow job for this annotation

GitHub Actions / release (ubuntu-24.04, 20)

Expected space(s) after "if"

// if we are looking at a plugin instance then
if (isClass(plugin.constructor) && plugin.constructor.name === 'Plugin') {
return Object.keys(plugin.manifest).length > 0 ||
Expand Down
6 changes: 6 additions & 0 deletions tasks/plugin-add.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
array: true,
default: [],
},
force: {
describe: 'Force install the plugin',
alias: ['f'],
type: 'boolean'

Check failure on line 36 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Missing trailing comma

Check failure on line 36 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Missing trailing comma

Check failure on line 36 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / release (ubuntu-24.04, 20)

Missing trailing comma
}

Check failure on line 37 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Missing trailing comma

Check failure on line 37 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Missing trailing comma

Check failure on line 37 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / release (ubuntu-24.04, 20)

Missing trailing comma
},
run: async options => {
const getPluginConfig = require('../utils/get-plugin-config');
Expand All @@ -42,6 +47,7 @@
options.config = merge({}, [
getPluginConfig(lando.config.pluginConfigFile, lando.config.pluginConfig),
lopts2Popts(options),
{ force: !!options.force }

Check failure on line 50 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

There should be no space after '{'

Check failure on line 50 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

There should be no space before '}'

Check failure on line 50 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Missing trailing comma

Check failure on line 50 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

There should be no space after '{'

Check failure on line 50 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

There should be no space before '}'

Check failure on line 50 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Missing trailing comma

Check failure on line 50 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / release (ubuntu-24.04, 20)

There should be no space after '{'

Check failure on line 50 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / release (ubuntu-24.04, 20)

There should be no space before '}'

Check failure on line 50 in tasks/plugin-add.js

View workflow job for this annotation

GitHub Actions / release (ubuntu-24.04, 20)

Missing trailing comma
]);

// reset Plugin static defaults for v3 purposes
Expand Down
Loading