Skip to content

Commit

Permalink
fix(Plugins): Ensure to keep options as passed to plugins up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Sep 24, 2021
1 parent b2df3cc commit e3af1f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/Serverless.js
Expand Up @@ -7,6 +7,7 @@ const ensureValue = require('type/value/ensure');
const ensureArray = require('type/array/ensure');
const ensureIterable = require('type/iterable/ensure');
const ensurePlainObject = require('type/plain-object/ensure');
const clear = require('ext/object/clear');
const { legacy, log } = require('@serverless/utils/log');
const _ = require('lodash');
const CLI = require('./classes/CLI');
Expand Down Expand Up @@ -293,7 +294,8 @@ class Serverless {
resolveCliInput.clear();
const { commands, options, isHelpRequest } = resolveCliInput(commandsSchema);
this.processedInput.commands = this.pluginManager.cliCommands = commands;
this.processedInput.options = this.pluginManager.cliOptions = options;
this.processedInput.options = options;
Object.assign(clear(this.pluginManager.cliOptions), options);
if (options.version) {
require('./cli/render-version')();
return;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -44,7 +44,7 @@
"dotenv": "^10.0.0",
"dotenv-expand": "^5.1.0",
"essentials": "^1.1.1",
"ext": "^1.5.0",
"ext": "^1.6.0",
"fastest-levenshtein": "^1.0.12",
"filesize": "^8.0.3",
"fs-extra": "^9.1.0",
Expand Down
4 changes: 3 additions & 1 deletion scripts/serverless.js
Expand Up @@ -138,6 +138,7 @@ const processSpanPromise = (async () => {
const path = require('path');
const uuid = require('uuid');
const _ = require('lodash');
const clear = require('ext/object/clear');
const Serverless = require('../lib/Serverless');
const resolveVariables = require('../lib/configuration/variables/resolve');
const isPropertyResolved = require('../lib/configuration/variables/is-property-resolved');
Expand Down Expand Up @@ -590,7 +591,8 @@ const processSpanPromise = (async () => {
({ command, commands, options, isHelpRequest, commandSchema } =
resolveInput(commandsSchema));
serverless.processedInput.commands = serverless.pluginManager.cliCommands = commands;
serverless.processedInput.options = serverless.pluginManager.cliOptions = options;
serverless.processedInput.options = options;
Object.assign(clear(serverless.pluginManager.cliOptions), options);
hasFinalCommandSchema = true;
}
} else {
Expand Down

0 comments on commit e3af1f3

Please sign in to comment.