Skip to content

Commit

Permalink
fix(CLI): Fix general help output when in context of AWS service
Browse files Browse the repository at this point in the history
No AWS specific commands were listed
  • Loading branch information
medikoo committed Sep 23, 2021
1 parent cbd2e64 commit 0833fd0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scripts/serverless.js
Expand Up @@ -184,6 +184,7 @@ const processSpanPromise = (async () => {

const resolveConfigurationPath = require('../lib/cli/resolve-configuration-path');
const readConfiguration = require('../lib/configuration/read');
const resolveProviderName = require('../lib/configuration/resolve-provider-name');

// Resolve eventual service configuration path
configurationPath = await resolveConfigurationPath();
Expand Down Expand Up @@ -241,7 +242,6 @@ const processSpanPromise = (async () => {
}

const resolveVariablesMeta = require('../lib/configuration/variables/resolve-meta');
const resolveProviderName = require('../lib/configuration/resolve-provider-name');

variablesMeta = resolveVariablesMeta(configuration);

Expand Down Expand Up @@ -481,6 +481,15 @@ const processSpanPromise = (async () => {
ensureResolvedProperty('provider\0region', { shouldSilentlyReturnIfLegacyMode: true });
}
})();

// Ensure to have full AWS commands schema loaded if we're in context of AWS provider
// It's not the case if not AWS service specific command was resolved
if (configuration && resolveProviderName(configuration) === 'aws') {
resolveInput.clear();
({ command, commands, options, isHelpRequest, commandSchema } = resolveInput(
require('../lib/cli/commands-schema/aws-service')
));
}
} else {
// In non-service context we recognize all AWS service commands
resolveInput.clear();
Expand Down

0 comments on commit 0833fd0

Please sign in to comment.