Skip to content

Commit

Permalink
feat(AWS Deploy): Introduce warning about deploy -f alias
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrzesik committed Oct 11, 2021
1 parent 771f99b commit 40f574f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cli/handle-error.js
Expand Up @@ -98,7 +98,7 @@ module.exports = async (exception, options = {}) => {
// It can happen e.g. during "plugin uninstall" command, where "serverless" originally
// installed a as peer dependency was removed
logWarning('Could not resolve path to locally installed error handler');
log.warning('Could not resolve path to locally installed error handler');
log.debug('Could not resolve path to locally installed error handler');
return null;
}
}
Expand Down
15 changes: 15 additions & 0 deletions lib/plugins/deploy.js
Expand Up @@ -2,6 +2,8 @@

const ServerlessError = require('../serverless-error');
const cliCommandsSchema = require('../cli/commands-schema');
const { logWarning } = require('../classes/Error');
const { log } = require('@serverless/utils/log');

class Deploy {
constructor(serverless, options) {
Expand Down Expand Up @@ -29,6 +31,19 @@ class Deploy {
};

this.hooks = {
'initialize': () => {
if (
this.serverless.processedInput.commands.join(' ') === 'deploy' &&
this.options.function
) {
logWarning(
'Please use "deploy function -f" command directly. Support for "deploy -f" alias is likely to be removed in the future.'
);
log.warning(
'Please use "deploy function -f" command directly. Support for "deploy -f" alias is likely to be removed in the future.'
);
}
},
'before:deploy:deploy': async () => {
const provider = this.serverless.service.provider.name;
if (!this.serverless.getProvider(provider)) {
Expand Down

0 comments on commit 40f574f

Please sign in to comment.