mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
fix(CLI): Ensure to copy and not modify preset schemas
While modyfing should not be problematic for regular usage, it introduces unexpected states to tests which test multiple runs in same process run
This commit is contained in:
parent
f1af86ab55
commit
64684f2ed5
@ -50,11 +50,7 @@ module.exports = (loadedPlugins, { providerName }) => {
|
||||
for (const hookName of Object.keys(loadedPlugin.hooks)) {
|
||||
const awsCommandName = optionalServiceCommandsHooksMap.get(hookName);
|
||||
if (awsCommandName && !commands.has(awsCommandName)) {
|
||||
const awsCommandSchema = awsServiceCommands.get(awsCommandName);
|
||||
const schema = {
|
||||
...awsCommandSchema,
|
||||
options: { ...awsCommandSchema.options },
|
||||
};
|
||||
const schema = _.merge({}, awsServiceCommands.get(awsCommandName));
|
||||
for (const awsSpecificOptionName of awsSpecificOptionNames) {
|
||||
delete schema.options[awsSpecificOptionName];
|
||||
}
|
||||
@ -70,13 +66,15 @@ module.exports = (loadedPlugins, { providerName }) => {
|
||||
if (commandConfig.type === 'entrypoint') continue;
|
||||
const fullCommandName = `${commandPrefix}${commandName}`;
|
||||
if (commandConfig.type !== 'container') {
|
||||
const schema = commands.get(fullCommandName) || {
|
||||
usage: commandConfig.usage,
|
||||
serviceDependencyMode: 'required',
|
||||
isHidden: commandConfig.isHidden,
|
||||
noSupportNotice: commandConfig.noSupportNotice,
|
||||
options: {},
|
||||
};
|
||||
const schema = commands.has(fullCommandName)
|
||||
? _.merge({}, commands.get(fullCommandName))
|
||||
: {
|
||||
usage: commandConfig.usage,
|
||||
serviceDependencyMode: 'required',
|
||||
isHidden: commandConfig.isHidden,
|
||||
noSupportNotice: commandConfig.noSupportNotice,
|
||||
options: {},
|
||||
};
|
||||
|
||||
if (commandConfig.lifecycleEvents) schema.lifecycleEvents = commandConfig.lifecycleEvents;
|
||||
if (commandConfig.options) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user